/303-nodejs-test

NodeJS test.

Primary LanguageJavaScript

303 Software NodeJS test

Simple NodeJS application for content management.

Development

Install dependencies:

$ npm i

Add configuration file:

$ cp config/config.json.example config/config.json

Create database if necessary:

$ npm run create:db

Run it:

$ npm run start

Technologies used

  • NodeJS
  • Express
  • Sequelize
  • PostgreSQL

Code Style

The Airbnb JavaScript code style is used in this project.

To run a linting tool (eslint) to check the code style, run:

$ npm run lint

Database scripts

To create a database for the current environment run:

$ npm run create:db

Run this command to execute pending migrations:

$ npm run migrate

or this one to revert a migration:

$ npm run migrate:undo

To run every seed execute the following command:

$ npm run seed

Available Endpoints

  • GET /contents : Obtains all entries.
  • GET /contents/{id} : Obtains a single entry.
  • POST /contents : Registers a new entry.
  • DELETE /contents/{id} : Deletes an entry.
  • PUT /contents/{id} : Updates an entry.