이유혁

error fix

node_modules/
\ No newline at end of file
node_modules/
API_config.js
\ No newline at end of file
......
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
......@@ -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))
......