update
This commit is contained in:
parent
88e412e33a
commit
653dbe5fb6
@ -1,4 +1,5 @@
|
||||
const Router = require('koa-router')
|
||||
const xml2js = require('xml2js')
|
||||
const r = new Router()
|
||||
// const koaBody = require('koa-body')
|
||||
const {
|
||||
@ -9,6 +10,19 @@ const {
|
||||
} = require('../../libs/line-message')
|
||||
|
||||
r.get('/youtube/webhook', async (c, n) => {
|
||||
let mode = c.query['hub.mode'] || ''
|
||||
let verifyToken = c.query['hub.verify_token'] || ''
|
||||
let challenge = c.query['hub.challenge']
|
||||
|
||||
if (mode) {
|
||||
if (mode === 'subscribe') {
|
||||
c.status = 200
|
||||
c.body = challenge
|
||||
} else {
|
||||
c.status = 403
|
||||
c.body = ''
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
r.post('/youtube/webhook', getRaw, async (c, n) => {
|
||||
|
@ -2,6 +2,7 @@ const Router = require('koa-router')
|
||||
const r = new Router()
|
||||
|
||||
r.use('/line', require('./line').routes())
|
||||
r.use('/google', require('./google').routes())
|
||||
// r.use('/twitch', require('./twitch').routes())
|
||||
|
||||
module.exports = r
|
||||
|
Loading…
Reference in New Issue
Block a user