Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Latest commit

 

History

History
63 lines (44 loc) · 1.88 KB

DEVELOPING.md

File metadata and controls

63 lines (44 loc) · 1.88 KB

Contacts Book

js-semistandard-style code style: prettier

Tech stack:

Initial code generated by: express-generator

How to start development:

1. Prepare the database

Change your database credential information at ./db/db-config.json:

{
    user: 'username',// your postgresql user
    host: 'localhost',// most of the time it will be localhost. If you use docker, please check their document
    database: 'contactsbook',// the database that your postgresql user account has rights to manage
    password: 'bdd8OC0qgd',// postgresql user account's password
    port: 5432// port number that your postgresql server is listening
}

Note: You must NOT commit your new configuration to the source code.

2. Setup database:
psql -U user-name -d database-name -a -f "./db/init.sql"
3. Folow connect-pg-simple's installation guide:
psql database-name < node_modules/connect-pg-simple/table.sql
4. Start the development server
npm start

If you make it right, your console will log: Database is connected! after you run one of these command to run the development server: npm start or:

Deploy the server:
npm run deploy

License

MIT © 2019