Skip to content

minjman2659/Express-rest-api

 
 

Repository files navigation

Express-rest-api-sample

NodeJS REST API sample with integration Express, Sequelize, Jest, Swagger, Docker

Configure Environment Variables

Open .env.sample file and edit the values and then
change file name .env.development or .env.production depending on your environment if you need to.

This project uses dotenv to read and use .env file

Project Start

This project requires Node 14 or later.

 1. yarn // install dependencies
 2. yarn dev // run server

Migration Skeleton

Create migration file using sequelize cli

  npx sequelize-cli migration:generate --name <name>

Running migrations

  yarn db:migrate

Sync database

  yarn db:sync

Test

To run test, install jest

  yarn test

Docker

To run postgreSQL:12 & minjman/express-rest-api containers include migration, use docker compose

  docker compose up

API Docs

[GET] http://localhost:3000/api/v1/docs , After run server in localhost.

image

About

express-rest-api-sample

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.9%
  • Other 1.1%