1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-10 02:27:29 +00:00
cloudtube/api/pages.js
2021-04-16 16:31:54 +12:00

17 lines
413 B
JavaScript

const {render} = require("pinski/plugins")
module.exports = [
{
route: "/", methods: ["GET"], code: async ({req}) => {
const userAgent = req.headers["user-agent"] || ""
const mobile = userAgent.toLowerCase().includes("mobile")
return render(200, "pug/home.pug", {mobile})
}
},
{
route: "/js-licenses", methods: ["GET"], code: async () => {
return render(200, "pug/js-licenses.pug")
}
}
]