정민혁

kakao keyboard api router fixed

......@@ -41,3 +41,5 @@ app.use(function(err, req, res, next) {
});
module.exports = app;
app.listen(3000, function(){
});
......
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/keyboard', function(req, res, next) {
//메뉴
var choice = {
"type":"buttons",
"buttons": ["설정", "번역","사전"]
router.get('/', function(req, res) {
const choice = {
type: "buttons",
buttons: ["설정", "번역","사전"]
};
res.set({
res.status(200).set({
'content-type': 'application/json'
}).send(JSON.stringigy(choice));
}).send(JSON.stringify(choice));
});
module.exports = router;
......
......@@ -2,8 +2,8 @@ var express = require('express');
var router = express.Router();
var bodyparser = require('body-parser');
app.use(bodyparser.urlencoded({extended: false}));
app.use(bodyparser.json());
router.use(bodyparser.urlencoded({extended: false}));
router.use(bodyparser.json());
router.post('/message', function(req, res, next) {
var user_key = req.body.user_key;
......@@ -40,8 +40,6 @@ router.post('/message', function(req, res, next) {
break;
}
}
};
res.json(msg);
});
......