22 lines
450 B
JavaScript
22 lines
450 B
JavaScript
const Router = require("koa-router")
|
|
const { route } = require(".")
|
|
const { serach, getinfo } = require("../util/douban")
|
|
|
|
const router = new Router({
|
|
prefix:"/videoInfo"
|
|
})
|
|
|
|
|
|
router.get("/search",async (ctx)=>{
|
|
let name = ctx.query.name
|
|
let info = await serach(name)
|
|
ctx.body = info
|
|
})
|
|
|
|
router.get("/getinfo",async (ctx)=>{
|
|
let url = ctx.query.url
|
|
let info = await getinfo(url)
|
|
ctx.body = info
|
|
})
|
|
|
|
module.exports = router |