Created
May 20, 2018 07:25
-
-
Save toughrogrammer/6846da13da7ca82f847baffa85275640 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const COGNITIVE_SERVICE_ENDPOINT ='https://southeastasia.api.cognitive.microsoft.com/face/v1.0'; | |
const API_KEY = process.env.COGNITIVE_SERVICE_API_KEY; | |
module.exports = async function (context, req) { | |
const faceListName = req.query.name; | |
const addFaceListAPIEndpoint = COGNITIVE_SERVICE_ENDPOINT | |
+ '/facelists/' + faceListName; | |
const response = await axios.put( | |
addFaceListAPIEndpoint, | |
{ | |
name: faceListName | |
}, | |
{ | |
headers: { | |
'Ocp-Apim-Subscription-Key': API_KEY, | |
'Content-Type': 'application/json' | |
} | |
} | |
); | |
context.res = { | |
status: 200 | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
브라우저에서
${MY_FUNCTION_APP_ENDPOINT}/api/createFaceList?name=my-face-list
를 주소창에 붙여넣고 실행