From 00787b234cbe938fa6f5bf8ffada7b711aaa9dd1 Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Mon, 23 Jun 2025 18:37:11 +0200 Subject: [PATCH] try with 2 prerendering routes --- .../output/functions/api.func/.vc-config.json | 7 ++++--- .vercel/output/functions/api.func/index.js | 3 --- .../output/functions/api.func/package.json | 3 +++ .vercel/output/functions/api.func/router.js | 19 +++++++++++++++++++ .../functions/api.prerender-config.json | 4 +++- .vercel/output/functions/gist.func | 1 + .../functions/gist.prerender-config.json | 5 +++++ .vercel/output/functions/pin.func | 1 + .../functions/pin.prerender-config.json | 5 +++++ 9 files changed, 41 insertions(+), 7 deletions(-) delete mode 100644 .vercel/output/functions/api.func/index.js create mode 100644 .vercel/output/functions/api.func/package.json create mode 100644 .vercel/output/functions/api.func/router.js create mode 120000 .vercel/output/functions/gist.func create mode 100644 .vercel/output/functions/gist.prerender-config.json create mode 120000 .vercel/output/functions/pin.func create mode 100644 .vercel/output/functions/pin.prerender-config.json diff --git a/.vercel/output/functions/api.func/.vc-config.json b/.vercel/output/functions/api.func/.vc-config.json index 7363da92..605ee7c0 100644 --- a/.vercel/output/functions/api.func/.vc-config.json +++ b/.vercel/output/functions/api.func/.vc-config.json @@ -1,4 +1,5 @@ { - "runtime": "nodejs20.x", - "handler": "index.js" -} \ No newline at end of file + "runtime": "nodejs22.x", + "handler": "router.js", + "launcherType": "Nodejs" +} diff --git a/.vercel/output/functions/api.func/index.js b/.vercel/output/functions/api.func/index.js deleted file mode 100644 index 266beea1..00000000 --- a/.vercel/output/functions/api.func/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export default async (req, res) => { - return res.send("hello world"); -}; \ No newline at end of file diff --git a/.vercel/output/functions/api.func/package.json b/.vercel/output/functions/api.func/package.json new file mode 100644 index 00000000..3dbc1ca5 --- /dev/null +++ b/.vercel/output/functions/api.func/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/.vercel/output/functions/api.func/router.js b/.vercel/output/functions/api.func/router.js new file mode 100644 index 00000000..2e27d26f --- /dev/null +++ b/.vercel/output/functions/api.func/router.js @@ -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 + } +} diff --git a/.vercel/output/functions/api.prerender-config.json b/.vercel/output/functions/api.prerender-config.json index b1d99442..9d85682a 100644 --- a/.vercel/output/functions/api.prerender-config.json +++ b/.vercel/output/functions/api.prerender-config.json @@ -1,3 +1,5 @@ { - "expiration": 5 + "expiration": 5, + "bypassToken": "r3fr3shT0k3n", + "passQuery": true } \ No newline at end of file diff --git a/.vercel/output/functions/gist.func b/.vercel/output/functions/gist.func new file mode 120000 index 00000000..3b9c9be4 --- /dev/null +++ b/.vercel/output/functions/gist.func @@ -0,0 +1 @@ +api.func \ No newline at end of file diff --git a/.vercel/output/functions/gist.prerender-config.json b/.vercel/output/functions/gist.prerender-config.json new file mode 100644 index 00000000..9d85682a --- /dev/null +++ b/.vercel/output/functions/gist.prerender-config.json @@ -0,0 +1,5 @@ +{ + "expiration": 5, + "bypassToken": "r3fr3shT0k3n", + "passQuery": true +} \ No newline at end of file diff --git a/.vercel/output/functions/pin.func b/.vercel/output/functions/pin.func new file mode 120000 index 00000000..3b9c9be4 --- /dev/null +++ b/.vercel/output/functions/pin.func @@ -0,0 +1 @@ +api.func \ No newline at end of file diff --git a/.vercel/output/functions/pin.prerender-config.json b/.vercel/output/functions/pin.prerender-config.json new file mode 100644 index 00000000..9d85682a --- /dev/null +++ b/.vercel/output/functions/pin.prerender-config.json @@ -0,0 +1,5 @@ +{ + "expiration": 5, + "bypassToken": "r3fr3shT0k3n", + "passQuery": true +} \ No newline at end of file