Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김대욱
/
trans
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김대욱
2020-11-27 20:24:35 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6391a11b935ce7b04c565c1be9f69487c5b29eca
6391a11b
1 parent
b83b4448
wish3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
app.js
app.js
View file @
6391a11
...
...
@@ -26,8 +26,23 @@ app.post('/hook', function (req, res) {
console
.
log
(
'[request message]'
,
eventObj
.
message
);
var
cmd
=
message
.
text
;
console
.
log
(
'[command]'
,
cmd
);
console
.
log
(
'[command]'
,
cmd
);
res
.
sendStatus
(
200
);
});
app
.
post
(
'/hook'
,
function
(
req
,
res
)
{
var
eventObj
=
req
.
body
.
events
[
0
];
var
source
=
eventObj
.
source
;
var
message
=
eventObj
.
message
;
// request log
console
.
log
(
'======================'
,
new
Date
()
,
'======================'
);
console
.
log
(
'[request]'
,
req
.
body
);
console
.
log
(
'[request source] '
,
eventObj
.
source
);
console
.
log
(
'[request message]'
,
eventObj
.
message
);
if
(
cmd
==
"영어"
){
transen
(
eventObj
.
replyToken
,
eventObj
.
message
.
text
);
}
...
...
Please
register
or
login
to post a comment