我正在尝试使用 html、css 和 javascript 制作单页应用程序。我想为其添加一些路由。我用nodejs和express制作了服务器端渲染的网站。如何为我的 SPA 创建路由系统?我们可以使用express进行客户端路由吗?如果没有,是否有其他方法可以表达客户端路由?
当我尝试使用 postgres + prisma 从表中删除所有项目时,出现错误
\n我有以下架构:
\nmodel Profile {\n id String @id @default(cuid())\n projects Project[]\n}\n\nmodel Project {\n id String @id @default(cuid())\n\n profile Profile @relation(fields: [profile_email], references: [email], onDelete: NoAction)\n profile_email String\n}\nRun Code Online (Sandbox Code Playgroud)\n这是客户端的代码:
\nmodel Profile {\n id String @id @default(cuid())\n projects Project[]\n}\n\nmodel Project {\n id String @id @default(cuid())\n\n profile Profile @relation(fields: [profile_email], references: [email], onDelete: NoAction)\n profile_email String\n}\nRun Code Online (Sandbox Code Playgroud)\n我得到的错误是这样的 -
\nInvalid `prisma.profile.deleteMany()` invocation in\nclear.js:6:24\n\n 3 const prisma = new PrismaClient();\n 4 \n 5 (async () …Run Code Online (Sandbox Code Playgroud)