Showing
3 changed files
with
9 additions
and
6 deletions
... | @@ -9,11 +9,10 @@ const bodyParser = require('body-parser'); | ... | @@ -9,11 +9,10 @@ const bodyParser = require('body-parser'); |
9 | var app = express(); | 9 | var app = express(); |
10 | app.use(bodyParser.json()); | 10 | app.use(bodyParser.json()); |
11 | 11 | ||
12 | -// var { google } = require('googleapis'); | ||
13 | - | ||
14 | var sad = require('./video_sad'); | 12 | var sad = require('./video_sad'); |
15 | 13 | ||
16 | 14 | ||
15 | + | ||
17 | app.post('/hook', function (req, res) { | 16 | app.post('/hook', function (req, res) { |
18 | 17 | ||
19 | var eventObj = req.body.events[0]; | 18 | var eventObj = req.body.events[0]; | ... | ... |
1 | +var Info = require('./Info'); | ||
2 | + | ||
1 | exports.check = function(message,replyToken){ | 3 | exports.check = function(message,replyToken){ |
2 | 4 | ||
3 | const rand_0to9 = Math.floor(Math.random() * 10); // 0~9까지 난수생성 | 5 | const rand_0to9 = Math.floor(Math.random() * 10); // 0~9까지 난수생성 |
... | @@ -6,8 +8,8 @@ exports.check = function(message,replyToken){ | ... | @@ -6,8 +8,8 @@ exports.check = function(message,replyToken){ |
6 | 8 | ||
7 | const request = require('request'); | 9 | const request = require('request'); |
8 | const TARGET_URL = 'https://api.line.me/v2/bot/message/reply' | 10 | const TARGET_URL = 'https://api.line.me/v2/bot/message/reply' |
9 | - //라인 고유 토큰 | 11 | + |
10 | - const TOKEN = 'Kb1/rQYz4MUhF8XyKQv7z9x0MxVQ5bX/XO8S/yt/1qQEJVAbsEFAaMvXKEOx9Umr7KhivfyDPfZHRRLFPngR0O4ZGWV2VFses8ufPE7uAdvYr4G6keBNAU69nBz5IC71HfbIrUHxXYqD7GfhVwXzpwdB04t89/1O/w1cDnyilFU=' | 12 | + |
11 | var { google } = require('googleapis'); | 13 | var { google } = require('googleapis'); |
12 | 14 | ||
13 | var service = google.youtube('v3'); | 15 | var service = google.youtube('v3'); |
... | @@ -42,7 +44,7 @@ exports.check = function(message,replyToken){ | ... | @@ -42,7 +44,7 @@ exports.check = function(message,replyToken){ |
42 | url: TARGET_URL, | 44 | url: TARGET_URL, |
43 | headers: | 45 | headers: |
44 | { | 46 | { |
45 | - 'Authorization': `Bearer ${TOKEN}` | 47 | + 'Authorization': `Bearer ${Info.TOKEN}` |
46 | }, | 48 | }, |
47 | json: | 49 | json: |
48 | { | 50 | { | ... | ... |
-
Please register or login to post a comment