1.0.6 • Published 10 years ago
mochapi v1.0.6
MochAPI
This is a simple mock api.
Installing
Simply run
npm install mochapi -gUsage
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.jsonIt 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 8080Will run the app on port 8080
Contributing
To start development first checkout the library
git clone https://github.com/redbeacon/mapiand you need to install the dependencies
cd mapi
npm installIn order to compile the code you need to install TypeScript
npm install typescript -gNow that you have all the dependencies just go into mapi folder and run typescript compiler
tscTypescript is configured to do everything automatically, you don't need to provide any arguments to the command.