Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Latest commit

 

History

History
48 lines (35 loc) · 981 Bytes

README.md

File metadata and controls

48 lines (35 loc) · 981 Bytes

backend

Backend API

Add Required Configuration

You must create a config file in path: /backend/config/options.js with the following content atleast, you can also add your secret options to this file (this file is added to .gitignore).

module.exports = {
  /* DB connection information*/
  db: {
    name: "db_name",
    host: "host_address",
    username: "username",
    password: "password"
  },
  /* Secret key to be used for authorization requests*/
  secret: "someSecretStringToUseForAuthorizationRequests"
}

Adding models

You can either add models from existing DB using npm run generate-models or manually write models in backend/db/models directory.

Associations

Associations can be defined inside db/association file.

Build Setup

# install dependencies
npm install

# generates models from existing DB
npm run generate-models

# start nodejs server using nodemon
npm run dev

# start nodejs server
npm run start