- Node.js
- Express.js
- PostgreSQL
- React.js
Initial code generated by: express-generator
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.
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
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:
npm run deploy
MIT © 2019