Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정민혁
/
TermProject_KakaoBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
정민혁
2018-11-25 21:55:30 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ae1136a7f2944d983ded52428ee21aad50aed1d9
ae1136a7
1 parent
c646fd58
kakao keyboard api router fixed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
app.js
routes/keyboard.js
routes/message.js
app.js
View file @
ae1136a
...
...
@@ -41,3 +41,5 @@ app.use(function(err, req, res, next) {
});
module
.
exports
=
app
;
app
.
listen
(
3000
,
function
(){
});
...
...
routes/keyboard.js
View file @
ae1136a
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
.
s
tatus
(
200
).
s
et
({
'content-type'
:
'application/json'
}).
send
(
JSON
.
stringi
g
y
(
choice
));
}).
send
(
JSON
.
stringi
f
y
(
choice
));
});
module
.
exports
=
router
;
...
...
routes/message.js
View file @
ae1136a
...
...
@@ -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
);
});
...
...
Please
register
or
login
to post a comment