Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 891 Bytes

README.md

File metadata and controls

57 lines (45 loc) · 891 Bytes

NodeJS Boilerplate

This is a boilerplate application for building REST APIs in Node.js using ES6 and Fastify. Intended for use with Postgres using Sequelize ORM.

Installation

This application uses yarn, so let's install yarn first.

npm install -g yarn

Install dependencies:

yarn

Usage

Set environment (vars):

cp .env-sample .env

Start server:

yarn start

Run tests:

# Run tests written in ES6
yarn test

Set up database:

Run migrations

sequelize db:migrate

Run seeds

sequelize db:seed:all

Create new migration file

sequelize model:generate --name User --attributes name:string,email:string

Generate new seed file

sequelize seed:generate --name add-new-user

** Database details can be updated in the .env file

License

ISC