/mock-backend

Basic API implementation with in-memory storage.

Primary LanguageJavaScript

mock-backend

Build Status

Node-based API with in-memory storage built with hapi.

API documentation is generated from route configuration using lout and can seen at at /docs.

Screen Shot

Installation & Usage

npm install
npm start

ngrok is an easy way to make your local server publicly accessible if required.

Data Persistence

When the server stops, your data is dead. So it goes.

Options

The following environment variables are used for configuring the server.

  • API_HOST - The hostname/ip to bind the server to (default: 0.0.0.0)
  • APP_PORT - The port to listen to requests on (default: 5000)

CORS (Cross-origin resource sharing)

By default, all routes are accessible from any origin. You may change that to a whitelist of origins in server/config/index.js - hapi.options.routes.cors.