Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이유혁
/
OSS_Project_Chatbot
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
이유혁
2019-11-18 14:49:53 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
70cb40a048452989943f9ee4a8571fea461155fa
70cb40a0
1 parent
2060968a
error fix
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
17 deletions
.gitignore
API_config.js
app.js
.gitignore
View file @
70cb40a
node_modules/
\ No newline at end of file
node_modules/
API_config.js
\ No newline at end of file
...
...
API_config.js
deleted
100644 → 0
View file @
2060968
const
client_id
=
'743DE__EstcaLZzEsO5f'
;
const
client_secret
=
'Y865wTpZ5y'
;
const
line_channel
=
{
channelAccessToken
:
'TgqvFO0cHkSMEiRkJhLMCbfNzzO4Yhpdf8Ov+cr4tBPh2teSilW22TfEfTlxMHFBGufqslip3EYSdppQTCAThCEzf4xc6q8YEtPjF66hmyGOpLZoPK41VTWorrkOmBmmqysb11rElm50Wz6kvM/gogdB04t89/1O/w1cDnyilFU='
,
channelSecret
:
'ff1a934d000f5bfa265ed9fe2eedb0e7'
,
};
module
.
exports
=
{
line_channel
:
line_channel
,
client_id
:
client_id
,
client_secret
:
client_secret
}
\ No newline at end of file
app.js
View file @
70cb40a
...
...
@@ -17,10 +17,10 @@ var languagedetect_api_url = 'https://openapi.naver.com/v1/papago/detectLangs';
const
client_id
=
config
.
client_id
;
const
client_secret
=
config
.
client_secret
;
// Line Channel Access Tocken
const
config
=
config
.
line_channel
;
const
line_access
=
config
.
line_channel
;
// create LINE SDK client
const
client
=
new
line
.
Client
(
config
);
const
client
=
new
line
.
Client
(
line_access
);
// create Express app
// about Express itself: https://expressjs.com/
...
...
@@ -34,7 +34,7 @@ app.get('/', (req, res) => {
// register a webhook handler with middleware
// about the middleware, please refer to doc
app
.
post
(
'/webhook'
,
line
.
middleware
(
config
),
(
req
,
res
)
=>
{
app
.
post
(
'/webhook'
,
line
.
middleware
(
line_access
),
(
req
,
res
)
=>
{
Promise
.
all
(
req
.
body
.
events
.
map
(
event
=>
handleEvent
(
event
)))
.
then
((
result
)
=>
res
.
json
(
result
))
...
...
Please
register
or
login
to post a comment