Skip to content

jonatns/magic-mock-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magic mock API

A magic mock API built using faker 🔮 Github

It generates data based on a query. In order to generate data you need to send a stringified JSON as a data query parameter with following format:

{
  "count": 2,
  "fields": {
    "id": "random.uuid",
    "firstName": "name.firstName",
    "lastName": "name.lastName",
    "email": "internet.email",
    "phone": "phone.phoneNumberFormat"
  }
}

Example request:

https://pitch-bookcase.glitch.me/mock?data={"count":2,"fields":{"id":"random.uuid","firstName":"name.firstName","lastName":"name.lastName","email":"internet.email","phone":"phone.phoneNumberFormat"}}
  • count: number of records you want to generate
  • fields: object containing all the fields you want to generate per record

Each field should be in the following format: { "key": "fakerAPIMethod" }

Please check faker for the full list of API methods

About

A magic mock API built using faker 🔮

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors