Lazy-load auth in middleware to prevent Prisma client init during prerender, harden prisma.config.ts with DATABASE_URL fallback, and remove unneeded generate step from CI build

This commit is contained in:
Esteban Paz 2026-08-16 14:47:17 -05:00
parent 5587f9fb76
commit ce5452a91a
2 changed files with 5 additions and 3 deletions

View File

@ -29,7 +29,6 @@ jobs:
node-version: '22'
- run: pnpm install --frozen-lockfile
- run: pnpm exec prisma generate
- run: pnpm run build
- name: Copy build to VPS

View File

@ -2,7 +2,7 @@
// This file was generated by Prisma and assumes you have installed the following:
// npm install --save-dev prisma dotenv
import "dotenv/config";
import { defineConfig, env } from "prisma/config";
import { defineConfig } from "prisma/config";
export default defineConfig({
schema: "prisma/schema.prisma",
@ -11,6 +11,9 @@ export default defineConfig({
},
engine: "classic",
datasource: {
url: env("DIRECT_URL") || env("DATABASE_URL"),
url:
process.env.DIRECT_URL ||
process.env.DATABASE_URL ||
"postgresql://localhost:5432/postgres?schema=public",
},
});