mirror of
https://github.com/4ev-link/4ev.link.git
synced 2026-01-13 16:18:05 +00:00
Delete: Renamed to create-users-v1.js
This commit is contained in:
@@ -1,13 +0,0 @@
|
|||||||
export async function onRequestPost({ request, env }) {
|
|
||||||
try {
|
|
||||||
const { admin_pass } = await request.json();
|
|
||||||
if (admin_pass !== env.ADMIN_PASS) return new Response("Unauthorized", { status: 401 });
|
|
||||||
|
|
||||||
const schema = `CREATE TABLE IF NOT EXISTS users (username TEXT PRIMARY KEY, pass_hash TEXT, custom_slugs TEXT);`;
|
|
||||||
await env.D1_EV.exec(schema);
|
|
||||||
|
|
||||||
return new Response("Schema v1 created successfully (if it did not exist).");
|
|
||||||
} catch (e) {
|
|
||||||
return new Response(e.message, { status: 500 });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user