jonatns / magic-mock-api

A magic mock API built using faker 🔮

Home Page:https://pitch-bookcase.glitch.me/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 🔮

https://pitch-bookcase.glitch.me/


Languages

Language:CSS 43.8%Language:JavaScript 38.5%Language:HTML 17.7%