Minkyung Ko

Add question12

......@@ -201,6 +201,47 @@ apiRouter.post('/question11', (req, res) => {
res.status(200).send(responseBody);
});
apiRouter.post('/question12', (req, res) => {
var mesg = req.body.userRequest.utterance;
var userId = req.body.userRequest.user.id;
var mbti = '';
if (mesg == "네"){
mbti = 'F';
}
else if (mesg == "아니오") {
mbti = 'T';
}
userDB[userId][2] += mbti;
console.log(userDB);
const responseBody = {
version: "2.0",
template: {
outputs: [
{
simpleText: {
text: '[question12]\n집과 업무 환경이 잘 정돈되어 있습니다.'
}
}
],
quickReplies: [
{
action: "block",
label: "네",
message: "네",
blockId: "6297811bf591aa190554a22e"
},
{
action: "block",
label: "아니오",
message: "아니오",
blockId: "6297811bf591aa190554a22e"
}
]
}
}
res.status(200).send(responseBody);
});
app.listen((process.env.PORT || 3000), function() {
console.log('Example skill server listening on port 3000!');
});
\ No newline at end of file
......