This project is sample code to demonstrate Express and the PostgreSQL driver.
npm install
- If you have not created a PostgreSQL database, initialize one with
npm run initdb
- Ensure the PostgreSQL server is running on localhost (
npm run postgres
) npm start
to start the server- Open your browser to http://localhost:3000/items and http://localhost:3000/total
In addition, the following commands will directly update or query the database:
npm run schema
will load the database schema into PostgreSQLnpm run sample_data
will load sample data into PostgreSQLnpm run sample_queries
will execute queries directly on the PostgreSQL databasenpm run drop
will drop all tables created bynpm run schema