Showing
1 changed file
with
9 additions
and
5 deletions
... | @@ -12,8 +12,9 @@ var bodyParser = require('body-parser'); | ... | @@ -12,8 +12,9 @@ var bodyParser = require('body-parser'); |
12 | var api_url = 'https://openapi.naver.com/v1/papago/n2mt'; | 12 | var api_url = 'https://openapi.naver.com/v1/papago/n2mt'; |
13 | 13 | ||
14 | // Naver Auth Key | 14 | // Naver Auth Key |
15 | -var client_id = '86rKmat0DijccSxKa01P'; | 15 | +//새로 발급받은 naver papago api id, pw 입력 |
16 | -var client_secret = 'rMapNjB8DP'; | 16 | +var client_id = 'xZMx34y7uru1v8lywZ2d'; |
17 | +var client_secret = 'p6L7M7WsH9'; | ||
17 | 18 | ||
18 | // Parse Application JSON | 19 | // Parse Application JSON |
19 | app.use(bodyParser.json()); | 20 | app.use(bodyParser.json()); |
... | @@ -21,6 +22,9 @@ app.use(bodyParser.json()); | ... | @@ -21,6 +22,9 @@ app.use(bodyParser.json()); |
21 | // Parse Application/x-www-form-urlencoded | 22 | // Parse Application/x-www-form-urlencoded |
22 | app.use(bodyParser.urlencoded({ extended: true})); | 23 | app.use(bodyParser.urlencoded({ extended: true})); |
23 | 24 | ||
25 | + | ||
26 | + | ||
27 | + | ||
24 | // Kakao Keyboard API | 28 | // Kakao Keyboard API |
25 | app.get('/keyboard', function(req, res) { | 29 | app.get('/keyboard', function(req, res) { |
26 | const menu = { | 30 | const menu = { |
... | @@ -59,15 +63,15 @@ app.post('/message', function(req, res) { | ... | @@ -59,15 +63,15 @@ app.post('/message', function(req, res) { |
59 | // Message 잘 찍히는지 확인 | 63 | // Message 잘 찍히는지 확인 |
60 | console.log(objBody.message.result.translatedText); | 64 | console.log(objBody.message.result.translatedText); |
61 | 65 | ||
62 | - // Kakao Message API | 66 | + // Kakao Message API |
63 | let massage = { | 67 | let massage = { |
64 | "message": { | 68 | "message": { |
65 | // Naver API Translate 결과를 Kakao Message | 69 | // Naver API Translate 결과를 Kakao Message |
66 | - "text": objBody.message.result.translatedText | 70 | + "text": objBody.message.result.translatedText |
67 | }, | 71 | }, |
68 | }; | 72 | }; |
69 | 73 | ||
70 | - // Kakao Message API 전송 | 74 | + // Kakao Message API 전송 |
71 | res.set({ | 75 | res.set({ |
72 | 'content-type': 'application/json' | 76 | 'content-type': 'application/json' |
73 | }).send(JSON.stringify(massage)); | 77 | }).send(JSON.stringify(massage)); | ... | ... |
-
Please register or login to post a comment