이유혁

error fix

1 -node_modules/
...\ No newline at end of file ...\ No newline at end of file
1 +node_modules/
2 +API_config.js
...\ No newline at end of file ...\ No newline at end of file
......
1 -const client_id = '743DE__EstcaLZzEsO5f';
2 -const client_secret = 'Y865wTpZ5y';
3 -
4 -const line_channel = {
5 - channelAccessToken: 'TgqvFO0cHkSMEiRkJhLMCbfNzzO4Yhpdf8Ov+cr4tBPh2teSilW22TfEfTlxMHFBGufqslip3EYSdppQTCAThCEzf4xc6q8YEtPjF66hmyGOpLZoPK41VTWorrkOmBmmqysb11rElm50Wz6kvM/gogdB04t89/1O/w1cDnyilFU=',
6 - channelSecret: 'ff1a934d000f5bfa265ed9fe2eedb0e7',
7 -};
8 -
9 -module.exports ={
10 - line_channel : line_channel,
11 - client_id : client_id,
12 - client_secret : client_secret
13 -}
...\ No newline at end of file ...\ No newline at end of file
...@@ -17,10 +17,10 @@ var languagedetect_api_url = 'https://openapi.naver.com/v1/papago/detectLangs'; ...@@ -17,10 +17,10 @@ var languagedetect_api_url = 'https://openapi.naver.com/v1/papago/detectLangs';
17 const client_id = config.client_id; 17 const client_id = config.client_id;
18 const client_secret = config.client_secret; 18 const client_secret = config.client_secret;
19 // Line Channel Access Tocken 19 // Line Channel Access Tocken
20 -const config = config.line_channel; 20 +const line_access = config.line_channel;
21 21
22 // create LINE SDK client 22 // create LINE SDK client
23 -const client = new line.Client(config); 23 +const client = new line.Client(line_access);
24 24
25 // create Express app 25 // create Express app
26 // about Express itself: https://expressjs.com/ 26 // about Express itself: https://expressjs.com/
...@@ -34,7 +34,7 @@ app.get('/', (req, res) => { ...@@ -34,7 +34,7 @@ app.get('/', (req, res) => {
34 34
35 // register a webhook handler with middleware 35 // register a webhook handler with middleware
36 // about the middleware, please refer to doc 36 // about the middleware, please refer to doc
37 -app.post('/webhook', line.middleware(config), (req, res) => { 37 +app.post('/webhook', line.middleware(line_access), (req, res) => {
38 Promise 38 Promise
39 .all(req.body.events.map(event => handleEvent(event))) 39 .all(req.body.events.map(event => handleEvent(event)))
40 .then((result) => res.json(result)) 40 .then((result) => res.json(result))
......