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-30 16:27:34 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
127fc6bce4052085785a86f004395f10336e9a83
127fc6bc
1 parent
233b7c7a
2wp
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
app.js
app.js
View file @
127fc6b
...
...
@@ -14,6 +14,7 @@ cert: cert,
ca
:
ca
},
app
).
listen
(
80
,()
=>
{
console
.
log
(
'server on 80'
);
console
.
log
(
status
)
});
https
.
createServer
({
...
...
@@ -52,10 +53,12 @@ const client = new line.Client(config);
// register a webhook handler with middleware
// about the middleware, please refer to doc
app
.
get
(
'/'
,(
req
,
res
)
=>
{
res
.
send
(
"hellow"
);
})
app
.
post
(
'/webhook'
,
line
.
middleware
(
config
),
(
req
,
res
)
=>
{
console
.
log
(
"webhook"
);
Promise
.
all
(
req
.
body
.
events
.
map
(
handleEvent
))
.
then
((
result
)
=>
res
.
json
(
result
))
});
// event handler
function
handleEvent
(
event
)
{
console
.
log
(
"handleevent"
);
...
...
Please
register
or
login
to post a comment