JKL

Server_Update

Showing 1 changed file with 25 additions and 1 deletions
...@@ -9,4 +9,28 @@ app.get('/keyboard', (req, res) => { ...@@ -9,4 +9,28 @@ app.get('/keyboard', (req, res) => {
9 res.json(data); 9 res.json(data);
10 }); 10 });
11 11
12 -app.listen(3000, () => console.log('node on 3000'));
...\ No newline at end of file ...\ No newline at end of file
12 +app.post('/message', (req, res) => {
13 + const question = req.body.userRequest.utterance;
14 + const goMain = '처음으로';
15 +
16 + if (question === '테스트') {
17 + const data = {
18 + 'version': '2.0',
19 + 'template': {
20 + 'outputs': [{
21 + 'simpleText': {
22 + 'text': '테스트'
23 + }
24 + }],
25 + 'quickReplies': [{
26 + 'label': goMain,
27 + 'action': 'message',
28 + 'messageText': goMain
29 + }]
30 + }
31 + }
32 + }
33 + res.json(data);
34 +});
35 +
36 +app.listen(23023, () => console.log('node on 23023'));
...\ No newline at end of file ...\ No newline at end of file
......