Skip to content

andre000/node-backend-example

Repository files navigation

node-backend-example

Version License: MIT

A example REST API example made with Node.js

API docs

Requirements

  • Docker
  • Node.js >= 12

1. Install

npm install

2. Setting up environment

docker-compose up -d

Two services will be created:

  • A MySQL database running on port 3306
  • A Database admin (adminer) running on port 8080 (http://localhost:8080)

Before start using the database, make sure that the container status is healthy using docker ps. (It may take up to 5 minutes)

3. Migration

Before using the project, the following command must be executed:

npm run db:migrate

4. Usage

npm run dev

The default port is 3333. But it can be changed on .env file

5. Run tests

In order to run the tests, a MySQL docker instance must be running with all migrations applied.

npm run test

6. Generating docs

npm run docs

Author

👤 Andre L. Adriano

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator