Skip to content

CronixMicroSystems/nodejs-js-boilerplate

Repository files navigation

nodejs-js-boilerplate

Installation:

  1. install node modules:

first for server:

yarn install

then for api-docs server:

cd docs/
yarn install
  1. Create database:

    mysql -u[username] -p[password]

    create database nodejs_boilerplate;

  2. Add username and password in config/index.js to connect to database

  3. Run migrations and seeds:

in project root directory:

yarn run migrate
yarn run seed

or

NODE_ENV=[env] node_modules/sequelize-cli/bin/sequelize db:migrate
NODE_ENV=[env] node_modules/sequelize-cli/bin/sequelize db:seed:all 

where [env] project environment (database by default)

Usage:

in project root directory:

  1. run server:

yarn run run

server will be run on http://localhost:5000/

  1. run api server:

yarn run docs

api server will be run on http://localhost:4000/

  1. run all:

yarn run all

run both server and docs