Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Toyurc/mockrest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MockRest

Installation (linux)

  • Clone the Repo
git clone http://github.com/deolu-asenuga/mockrest
  • Install it
cd mockest/ && sudo make install

Usage

Single Endpoint
  • to serve a json file (test.json) in the same directoy
mockrest serve test.json

navigate to localhost:3000/mockrest to see the result

  • to serve a json file (test.json) from an endpoint "/end" on port 4000
mockrest serve test.json -e /end -p 4000
  • Navigate to localhost:4000/end to see the ressponse
Multiple Endpoints
  • Create a config file ( default is "mockrest.json")
  • Populate with configurations eg
{
  "global":{
    "port":"3000"
  },
  "endpoints":[
    {"url":"/" , "payload":{"hello":"world"}}
  ]
}
  • run mockrest in the same directory
mockrest
  • Navigate to localhost:3000/ to see the result

About

serve json files on localhost

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published