Skip to content

lborgav/mockingbird

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mockingbird - Simple HTTP mock server

WORK IN PROGRESS

Build Status

Install

For now, clone this repo and install the required modules with yarn or npm, and link:

$ yarn install
$ yarn link

Now you have the mockingbird cli

Usage

Prepare a json file with the following format:

//mock.json
{
  "8080": {
    "GET /numbers": [1, 2, 3, 4, 5]
  },
  "8081": {
    "POST /login": {
      "token": "fkj34rDjhf",
      "logged": true
    }
  }
}

It is a dictionary with the port you want to follow where the values are dictionaries with the method and the path you want to mock with the respective response. Now execute the following command on terminal:

$ mockingbird mock.json

If we do a GET on localhost:8080/numbers, we have [1, 2, 3, 4, 5] as response

Testing

$ yarn test

License

MIT

Releases

No releases published

Packages

No packages published