import { Database } from '@db/sqlite';

import { migrate } from '@/backend/db-schema.ts';
import { makeRoutes } from '@/backend/routes.ts';

async function main() {
	const db = new Database('shelves.db');
	await migrate(db);

	const handler = makeRoutes(db);

	await Deno.serve({ port: 8444 }, handler);
}

await main();
