Template
Nuxt coursework boilerplate: Tailwind, Drizzle (MySQL), Redis, Pug page, Vercel deploy workflow
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { db } from "~~/server/db";
|
||||
import { notes } from "~~/server/db/schema";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const body = await readBody<{ title: string; body: string }>(event);
|
||||
await db.insert(notes).values({ title: body.title, body: body.body });
|
||||
return { ok: true };
|
||||
});
|
||||
Reference in New Issue
Block a user