Skip to content

Latest commit

 

History

History
103 lines (66 loc) · 1.77 KB

README.md

File metadata and controls

103 lines (66 loc) · 1.77 KB

Listem API

Requirements

Setup

Dependencies

Install dependencies:

$ npm install

Environment variables

Copy example file and edit it providing correct data:

$ cp .env.example .env
$ vim .env

Database

  1. Create development and test databases:

    $ npm run db:create
    $ NODE_ENV=test npm run db:create
    
  2. Run all migrations:

    $ npm run db:migrate
    $ NODE_ENV=test npm run db:migrate
    

IDE

IntelliJ IDEA / WebStorm / PhpStorm:

  1. Install the following plugins:

  2. Go to File > Settings > Languages & Frameworks > JavaScript > Prettier

    Check run for files On save and use below as a value:

    {**/*,*}.{js,json,md,yml}
    

From now on every change in code base will be automatically formatted by Prettier.

Development

Run server and start hacking:

$ npm start

Tests

  1. Run tests:

    $ npm test
    
  2. Run tests in watch mode:

    $ npm run test:watch
    
  3. Generate code coverage report:

    $ npm run test:coverage
    

Documentation

  1. Run server:

    $ npm start
    
  2. Explore API docs at http://localhost:3001/api/docs/

  3. Edit docs/swagger.yml file to update API docs.