tchai81 / expressjs-simple-audit-history

Rest API prototype build based on Expressjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Framework

Prototype build based on https://github.com/diegohaz/rest
Database: MySQL
ORM - http://docs.sequelizejs.com/

Getting Started

  1. git clone https://github.com/tchai81/demo-api.git
  2. Navigate to the folder
$ cd <folder-name>
  1. Installing dependencies
$ npm install
  1. Replicating .env from .env.example
$  cp .env.example .env
  1. Create a MySQL database on your local and state down all details
  2. Make necessary changes to .env
  3. Execute database migration by navigating to \src
$  ../node_modules/.bin/sequelize db:migrate
  1. To restore database to a clean state
$ ../node_modules/.bin/sequelize db:migrate:undo:all
  1. Start the server
$ npm run prod

Constraints & Assumptions

  1. For {"key" : "value"} pair, "value" only accepts String
  2. For getting a value for a key with timestamp, if timestamp is earlier than creation date, null will be returned
  3. Unit test is incomplete
  4. While testing on live url, you may encountering server not responding error. Please bear with this as this application is hosted on a free tier service.

About

Rest API prototype build based on Expressjs


Languages

Language:JavaScript 100.0%