breakout into monorepo

This commit is contained in:
Dominic Ferrando
2026-03-02 13:39:47 -05:00
parent 6421f6527f
commit 45acec2cfd
90 changed files with 12179 additions and 2987 deletions
+2
View File
@@ -0,0 +1,2 @@
deploy:
npx wrangler deploy
+17
View File
@@ -0,0 +1,17 @@
export default {
async fetch(request: Request, env: Env) {
if (request.method !== "POST") {
return new Response("Method Not Allowed", { status: 405 });
}
const body = await request.json().catch(() => null);
if (!body) return new Response("Bad Request", { status: 400 });
const key = `calc:${Date.now()}:${crypto.randomUUID()}`;
await env.CALCULATOR_LOGGING.put(key, JSON.stringify(body));
return new Response(JSON.stringify({ ok: true, key }), {
headers: { "content-type": "application/json" },
});
},
} satisfies ExportedHandler<Env>;
+5
View File
@@ -0,0 +1,5 @@
fetch("https://kv-logger.xominus.workers.dev", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ "test": 1 })
}).catch((e) => { console.error(e) });
+7
View File
@@ -0,0 +1,7 @@
name = "kv-logger"
main = "src/index.ts"
compatibility_date = "2025-10-17"
[[kv_namespaces]]
binding = "CALCULATOR_LOGGING"
id = "4b585549cf074f729d9ec4ac39e2c879"