SaadBadr / vending-machine

Vending Machine REST API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vending Machine API

REST API for a vending machine

NodeJS ExpressJS MongoDB

How to run

First, please make sure you have Node.js installed.
  1. navigate to the project folder
cd vending-machine
  1. install npm dependencies
npm i
  1. start it!
npm start

Documentaion

You can find the api documentation at Postman

Important notes

  • config.env file in project's root directory is used to store the configuration "env. variables"
  • In config.env, you can change NODE_ENV from development to production and vice versa
    • development: error details and stack is returned, also logs are logged to the console
    • production: production error version is returned, logs are logged to logs files
  • The api default url is localhost:8000/api/v1
    • Can be changed from config.env
  • This is a simple project aims to learn and practice, In real production application .env and .pem files shouldn't be added to the repo.
  • the command node utils/generatePublicAndPrivateKeys.js is used to generate '.pem' files in the jwt-keys folder under '/config'

About

Vending Machine REST API


Languages

Language:JavaScript 98.4%Language:Shell 1.6%