Toggle navigation
Toggle navigation
This project
Loading...
Sign in
term-project
/
project
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
Solhee
2020-12-08 01:00:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
edb45b32ebf029b930f0c149ab4a64e233d6fefa
edb45b32
1 parent
9c98bee8
Debug_EncryptAndMessageHandling2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
express/app.js
express/app.js
View file @
edb45b3
...
...
@@ -36,8 +36,9 @@ app.use(bodyParser.json());
function
first
(
text1
){
if
(
text1
==
'y'
)
if
(
text1
==
'y'
)
{
return
true
;
}
else
return
false
;
}
...
...
@@ -49,7 +50,7 @@ function hello(eventObj){
'Authorization'
:
`Bearer
${
TOKEN
}
`
},
json
:{
"replyToken"
:
eventObj
,
replyToken
,
"replyToken"
:
eventObj
.
replyToken
,
"messages"
:[
{
"type"
:
"text"
,
...
...
@@ -76,8 +77,8 @@ app.post('/hook', function (req, res) {
var
eventObj
=
req
.
body
.
events
[
0
];
var
source
=
eventObj
.
source
;
var
message
=
eventObj
.
message
;
var
text
;
var
text1
;
var
message_text
=
message
.
text
;
//
var text1;
var
text2
;
var
findfoods
;
...
...
@@ -86,14 +87,16 @@ app.post('/hook', function (req, res) {
console
.
log
(
'[request]'
,
req
.
body
);
console
.
log
(
'[request source] '
,
eventObj
.
source
);
console
.
log
(
'[request message]'
,
eventObj
.
message
);
text
=
hello
(
text1
);
text
=
first
(
message_text
);
if
(
text
==
true
){
console
.
log
(
'Hi'
,
message
);
hello
(
text2
);
hello
(
eventObj
);
}
else
{
getfoodinfo
(
eventObj
.
replyToken
);
getfood
(
eventObj
.
replyToken
);
}
res
.
sendStatus
(
200
);
});
...
...
Please
register
or
login
to post a comment