mock api is an application that allows you to import or create a csv file and generate a simple api to use while testing/developing your application
Presented with an empty table on when application first starts running
Clicking on any cell in a row will allow you to edit it's value
After pressing the 'Start' button the api will start listening and serving requests on the localhost port
from the above table, querying https://localhost:7192/api/data/ would return a all rows as a json response
{
"id": "0",
"house" : "123 street",
"numOccupants" : "1",
"numPets" : "2"
},
{
"id" : "1",
"house" : "456 lane",
"numOccupants" : "2",
"numPets" : "2"
}a query to return all rows with 1 occupant: https://localhost:7192/api/data/select?where=numOccupants&is=1
would return
{
"id": "0",
"house" : "123 street",
"numOccupants" : "1",
"numPets" : "2"
}All data returned from the api is in json format.
Data returned from the endpoint is as a json dictionary eg.
{
"id" : "1",
"column1" : "value1",
"column2" : "value2",
"column3" : "value3"
}the id key/value is the rows index in the table this value is used when wanting to
- get an individual row
- updating a row
- deleting it
-
Get
/api/data/- returns all rows in the table
-
GET
/api/data/:id- returns the row with a matching id (the id is the rows index)
-
GET
/api/data/select?where={column name}&is={value}- searches rows for matching column/value pair, returns all rows that match
- optional
limitparameter to only return a set amount, by default all matching rows will be returned - eg. limit to 1 row:
/api/data/select?where={column name}&is={value}&limit=1
Endpoints to update, delete and create rows are in development
-
Crud column
- create
- read
- update
- delete
-
Crud row
- create
- read
- update
- delete
-
Get data endpoints
- return all endpoint
- select endpoint
- return by id endpoint
- implement an inbuilt route tester/generator


