Toggle navigation
Toggle navigation
This project
Loading...
Sign in
은승우
/
LINEBOT
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
은승우
2019-11-29 18:45:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
328b8584784e7a2c4f929d5289080d61af3d9bf0
328b8584
1 parent
3c4e5338
cn
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
app.js
app.js
View file @
328b858
...
...
@@ -32,6 +32,7 @@ const client = new line.Client(config);
// register a webhook handler with middleware
// about the middleware, please refer to doc
app
.
post
(
'/webhook'
,
line
.
middleware
(
config
),
(
req
,
res
)
=>
{
console
.
log
(
"webhook"
);
Promise
.
all
(
req
.
body
.
events
.
map
(
handleEvent
))
.
then
((
result
)
=>
res
.
json
(
result
))
...
...
@@ -43,6 +44,7 @@ app.post('/webhook', line.middleware(config), (req, res) => {
// event handler
function
handleEvent
(
event
)
{
console
.
log
(
"handleevent"
);
if
(
event
.
type
!==
'message'
||
event
.
message
.
type
!==
'text'
)
{
// ignore non-text-message event
return
Promise
.
resolve
(
null
);
...
...
Please
register
or
login
to post a comment