barebones docker | pocketbase | hono | svelte

This commit is contained in:
JCEEE
2026-06-23 21:49:54 +01:00
parent 2253b54077
commit f9d9fa9ace
105 changed files with 27341 additions and 97 deletions
@@ -0,0 +1,24 @@
//#region src/routes/app/debug/increment-svelte/+server.ts
var { PB_URL = "http://127.0.0.1:8090", PB_SUPERUSER_EMAIL = "", PB_SUPERUSER_PASSWORD = "", DEBUG_RECORD_ID = "" } = process.env;
async function POST() {
const { token } = await (await fetch(`${PB_URL}/api/collections/_superusers/auth-with-password`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
identity: PB_SUPERUSER_EMAIL,
password: PB_SUPERUSER_PASSWORD
})
})).json();
const current = (await (await fetch(`${PB_URL}/api/collections/debug/records/${DEBUG_RECORD_ID}`, { headers: { Authorization: `Bearer ${token}` } })).json()).svelte_count || 0;
await fetch(`${PB_URL}/api/collections/debug/records/${DEBUG_RECORD_ID}`, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`
},
body: JSON.stringify({ svelte_count: current + 1 })
});
return new Response(JSON.stringify({ ok: true }), { headers: { "content-type": "application/json" } });
}
//#endregion
export { POST };