node-mocker-server

0.0.1 • Public • Published

node-mocker-server (Copied from node-mock-server)

This repository is copied from https://github.com/smollweide/node-mock-server (based on v0.25.4).

The original version can only run on local environment, since it relys on open or start command to open the files for editting responses etc.. However we may need to run the mock server on a server or docker environment, so change it a little bit for that purpose.

Changes made:

  • Add code editor on the method modal, when selecting responses, persisted response text would be reflected in the editor
  • Add the Save button on the method modal, to persist modified response
  • Remove preview feature which relys open on the method modal

File based Node REST API mock server

node-mock-server-ui.png

Getting Started

This application requires Node 6 or higher. For Node <6 please use node-mock-server@0.22.1 For Node <4 please use node-mock-server@0.11.0

1. Install npm package:
$ npm install node-mock-server --save-dev
2. Start init process:
$ node node_modules/node-mock-server/init

Options

node-mock-server options

Usage examples

node-mock-server usage examples

Features

CLI

$ node <nodeScript> --help

  Usage
    $ node <nodeScript> [--version] [--help] <command> [<args>]

  Options
    $                  start mock server
    $ --version        print node-mock-server version
    $ --help           print help
    $ swagger-import   run a swagger import
    $ validate         run a validation for all mock data
    $ collections      print all available collections
    $ collection <id>  activate collection

  Examples
    $ node demo/index.js --version
    $ node demo/index.js collections

Demo

git clone https://github.com/smollweide/node-mock-server.git
cd node-mock-server
npm install
node demo

License

MIT License

Changelog

Please see the Releases

Package Sidebar

Install

npm i node-mocker-server

Weekly Downloads

4

Version

0.0.1

License

MIT

Unpacked Size

1.33 MB

Total Files

113

Last publish

Collaborators

  • zerostone