stubs-server

Module to mock API via json stubs


Keywords
JSON, node, server, fake, API, prototyping, mock, mocking, test, testing, rest, dummy
License
MIT
Install
npm install stubs-server@3.8.0

Documentation

Stubs Server

UI interface for creating and mocking API responses via json stubs.

Setup

  1. Create a folder 'stubs' which will contains all the json stubs files
  2. Just run npx stubs-server and your stubs will hosted on port 9001.
  3. Open https://localhost:9001,
  4. This will open the stubs-ui console where you can create or edit your stubs.
  5. Create new stubs by clicking 'Create New Stub'.
  6. Type the 'api name'(e.g "test") and enter valid json and Click 'Add API'.
  7. Search for API, edit and save.
  8. Test your mock api by going to browser "http://localhost:9001/test".
  9. Your other routes will work as normal.

UI Screenshot

stubs-server

image

image