mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2026-03-02 02:31:35 +00:00
Autofocus search if user-agent not a mobile device
This commit is contained in:
parent
54ae21685f
commit
848651757a
3 changed files with 13 additions and 3 deletions
11
api/pages.js
Normal file
11
api/pages.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
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})
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue