Skip to content

michalszc/Library-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Library-api

Express.jsMongoDBESLintLodash.ENVDocker

Library-api is a REST API that provides endpoints for querying database.

Database Diagram

diagram

Documentation

List of available endpoints is described HERE.

Installation

Clone the repo and install dependencies:

git clone https://github.com/michalszc/Library-api.git
cd Library-api
npm install

Set environment variables (.env):

NODE_ENV=development
PORT=8080
MONGO_URI=mongodb://127.0.0.1:27017/library

Running in Development

npm run dev

Running in Production

npm run start

Lint

# lint code with ESLint
npm run eslint

# try to fix ESLint errors
npm run eslint:fix

Test

# run all tests with jest
npm run test

# run all tests and watch for changes
npm run test:watch

# run all tests and report coverage information
npm run test:coverage

Validate

# run lint and tests
npm run validate

Logs

# show logs in production
pm2 logs

Generate Documentation

# generate documentation
npm run docs

Docker

# run container in development
npm run docker:dev

# run container in production
npm run docker:prod

License

Licence