use DATABASE_URL for node api
This commit is contained in:
@ -1,10 +1,6 @@
|
||||
.PHONY: run-local
|
||||
run-local:
|
||||
PGUSER=postgres \
|
||||
PGHOST=localhost \
|
||||
PGPASSWORD=foobarbaz \
|
||||
PGDATABASE=postgres \
|
||||
PGPORT=5432 \
|
||||
DATABASE_URL=postgres://postgres:foobarbaz@localhost:5432/postgres \
|
||||
node ./src/index.js
|
||||
|
||||
.PHONY: build-naive
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
const { Pool } = require('pg');
|
||||
|
||||
const pool = new Pool();
|
||||
const pool = new Pool({
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
});
|
||||
|
||||
// the pool will emit an error on behalf of any idle clients
|
||||
// it contains if a backend error or network partition happens
|
||||
|
||||
Reference in New Issue
Block a user