Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 898 Bytes

README.md

File metadata and controls

38 lines (29 loc) · 898 Bytes

Building REST API in Node/Express App using Sequelize,Postgres

This Repository is building REST API Design in Node/Express App using Sequelize and Postgres.

PreRequisites

Setup

 $ npm install
 $ node_modules/.bin/sequelize init

Sequelize init will creat a folder config,controller,migrations and models

create a file called .sequelizerc

const path = require('path');

module.exports = {
  "config": path.resolve('./server/config', 'config.json'),
  "models-path": path.resolve('./server/models'),
  "seeders-path": path.resolve('./server/seeders'),
  "migrations-path": path.resolve('./server/migrations')
};

Create a Database testdb in Postgres Dashboard

$ node_modules/.bin/sequelize db:migrate      

To Run Application

$ node index.js