try with 2 prerendering routes

This commit is contained in:
martin-mfg
2025-06-23 18:37:11 +02:00
parent 03e15ecf12
commit 00787b234c
9 changed files with 41 additions and 7 deletions
@@ -1,4 +1,5 @@
{
"runtime": "nodejs20.x",
"handler": "index.js"
}
"runtime": "nodejs22.x",
"handler": "router.js",
"launcherType": "Nodejs"
}
@@ -1,3 +0,0 @@
export default async (req, res) => {
return res.send("hello world");
};
@@ -0,0 +1,3 @@
{
"type": "module"
}
@@ -0,0 +1,19 @@
import { default as gist } from './core-app/api/gist.js'
import { default as pin } from './core-app/api/pin.js'
export default async (req, res) => {
const url = new URL(req.url, 'https://localhost')
req.query = Object.fromEntries(url.searchParams.entries())
switch(url.pathname) {
case '/gist':
gist(req, res)
break
case '/pin':
pin(req, res)
break
default:
res.statusCode = 404
res.end('Not Found')
break
}
}
@@ -1,3 +1,5 @@
{
"expiration": 5
"expiration": 5,
"bypassToken": "r3fr3shT0k3n",
"passQuery": true
}
+1
View File
@@ -0,0 +1 @@
api.func
@@ -0,0 +1,5 @@
{
"expiration": 5,
"bypassToken": "r3fr3shT0k3n",
"passQuery": true
}
+1
View File
@@ -0,0 +1 @@
api.func
@@ -0,0 +1,5 @@
{
"expiration": 5,
"bypassToken": "r3fr3shT0k3n",
"passQuery": true
}