simple-fs-server/dev.ts
2023-01-14 03:03:22 +09:00

18 lines
546 B
TypeScript

#!/usr/bin/env -S deno run -A --watch=static/,routes/
import { connectDB } from "./src/user/db.ts";
import * as users from "./src/user/user.ts";
import dev from "$fresh/dev.ts";
await devUserAdd();
await dev(import.meta.url, "./main.ts");
async function devUserAdd() {
if(Deno.env.get("DB_PATH") === ":memory:") {
const db = await connectDB();
const username = "admin";
const password = "admin";
const new_user = await users.createUser(username, password);
await users.addUser(db, new_user);
}
}