PostgreSQL setup

PHOTO EMBED

Thu Aug 19 2021 19:17:02 GMT+0000 (Coordinated Universal Time)

Saved by @ExplodeMilk #express #typescript #socketio

import {Client} from 'pg';
import dotenv from 'dotenv';
dotenv.config();

export const client = new Client({
    database: process.env.DB_NAME,
    user: process.env.DB_USERNAME,
    password: process.env.DB_PASSWORD
});

client.connect();

/--------.env file ------------/
DB_NAME=memo-wall
DB_USERNAME=gordon
DB_PASSWORD=gordon
content_copyCOPY

npm install pg @types/pg dotenv @types/dotenv