mochapi
Simple Api Mocking
Last updated 5 years ago by techshed .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mochapi -g
SYNC missed versions from official npm registry.

MochAPI

This is a simple mock api.

Installing

Simply run

npm install mochapi -g

Usage

You need to create your own JSON fixture file in following format

{
 "URL": {
  "METHOD": {
    "response": // your response,
    "status": STATUS_CODE // 200 by default
  }
 }
}

When you created the file, just point it to mapi

mapi fixtures.json

It will start an api server on your local host simply visit http://localhost:9000/_mapi/ and see the parsed fixtures file.

You can also configure it to run on different port by providing port number after the fixture file

mapi fixtures.json 8080

Will run the app on port 8080

Contributing

To start development first checkout the library

git clone https://github.com/redbeacon/mapi

and you need to install the dependencies

cd mapi
npm install

In order to compile the code you need to install TypeScript

npm install typescript -g

Now that you have all the dependencies just go into mapi folder and run typescript compiler

tsc

Typescript is configured to do everything automatically, you don't need to provide any arguments to the command.

Current Tags

  • 1.0.6                                ...           latest (5 years ago)

7 Versions

  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |