mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-12 19:37:29 +00:00
13 lines
363 B
JavaScript
13 lines
363 B
JavaScript
|
const fetch = require("node-fetch")
|
||
|
const {render} = require("pinski/plugins")
|
||
|
|
||
|
module.exports = [
|
||
|
{
|
||
|
route: "/channel/([A-Za-z0-9-_]+)", methods: ["GET"], code: async ({fill}) => {
|
||
|
const id = fill[0]
|
||
|
const data = await fetch(`http://localhost:3000/api/v1/channels/${id}`).then(res => res.json())
|
||
|
return render(200, "pug/channel.pug", {data})
|
||
|
}
|
||
|
}
|
||
|
]
|