-
Install PostgreSQL and node.js if not already
-
Clone this repository and cd into the project root directory
-
run
npm i
-
run `psql -d postgres -U <your_user>
-
run
CREATE DATABASE api;
-
run
\c api
-
run
api=> CREATE TABLE users (ID SERIAL PRIMARY KEY, name VARCHAR(30), email VARCHAR(30));
-
Enter sample data (optional) and exit psql with control-d
-
run
touch pgConfig.js
and enter the following content:const Pool = require('pg').Pool; module.exports = pool = new Pool({ user: '<your_username>', host: 'localhost', database: 'api', password: '<your_password>', port: 5432 });
-
run
node app.js