Skip to content

Commit

Permalink
Default to local PG DB if no DB URL is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-dp committed Dec 12, 2024
1 parent 309f768 commit e9e0625
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/nextjs/app/api/items/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { NextResponse } from "next/server"
import { Pool } from "pg"

const client = new Pool({
connectionString: process.env.DATABASE_URL,
connectionString:
process.env.DATABASE_URL ??
`postgresql://postgres:password@localhost:54321/electric`,
})

export async function POST(request: Request) {
Expand Down

0 comments on commit e9e0625

Please sign in to comment.