Sign inSign up

firef0x/json-server

By firef0x

•Updated over 10 years ago

Most powerful JSON mock server

Image
0

363

firef0x/json-server repository overview

⁠Sly.js

⁠One of the Most powerful JSON mock server

Build your mock server within 1 minute, Powered by [email protected]⁠, Mock.js⁠, Faker⁠, SemanticUI⁠, ACE⁠

⁠Feature

  • Build API online with few editing
  • Mock flexible data format you like
  • Flexible route parser
  • Utilize param variable of path
  • JSON validation

⁠LiveDemo⁠

⁠Usage

//clone
//change to directory
> npm install && node index.js //that's all

And then open http://localhost:3003 in your browser

⁠Example

⁠Simple
//path
/people/:name 

//mock data
{
  "name": "jack"
}

//http://localhost:3003/people/jack
//output: "jack"
⁠Advanced
//path
/people/:name 

//mock data
{
  "name": "people - ${name}"
}

//http://localhost:3003/people/jack
//output: "people - jack"

You can utilize all the param variable in mock data, Mock and Faker alse provided.

//path
/people/:name 

//mock data
{
  "name": "people - ${faker.name.findName()}",
  "age": "${Mock.mock('@natural(60, 100)')}"
}

//http://localhost:3003/people/jack
//output: 
//  {
//    "name": "people - Marshall Pfannerstill",
//    "age": "94"
//  }

⁠License

MIT

Tag summary

Content type

Image

Digest

Size

284.8 MB

Last updated

over 10 years ago

docker pull firef0x/json-server