Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/martinstarman/instantapi
Instant API for development
https://github.com/martinstarman/instantapi
api data micro mock random
Last synced: about 2 months ago
JSON representation
Instant API for development
- Host: GitHub
- URL: https://github.com/martinstarman/instantapi
- Owner: martinstarman
- License: mit
- Created: 2017-04-07T20:46:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-11-26T11:39:36.000Z (about 4 years ago)
- Last Synced: 2024-08-04T00:12:39.141Z (5 months ago)
- Topics: api, data, micro, mock, random
- Language: JavaScript
- Size: 8.79 KB
- Stars: 17
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micro - instantapi - Local instant development api. (Development Tools / Utilities)
README
# instantapi.js
## Usage
Start server with```
npm start
```Request
```
$.get("http://localhost:3210/" + encodeURIComponent(JSON.stringify(
{
users: {
firstName: "@str(10, 20)",
lastName: "@str(10, 20)",
age: "@num(0, 100)",
"@repeat": 5
}
}
)))
```and response
```
{
"users": [
{
"firstName": "XsrKtIRHJd",
"lastName": "ScKmfVDGTxIeooZHF",
"age": 28
},
{
"firstName": "RcpwGUxKtn",
"lastName": "SbcEfIvvrpMBeULMU",
"age": 89
},
{
"firstName": "zoabOugVGAg",
"lastName": "HRPbiNEgEt",
"age": 90
},
{
"firstName": "CCpBLPsZhSqOKtVe",
"lastName": "hNWfZABkHpo",
"age": 37
},
{
"firstName": "TseRpbCjhaAgmxBgsP",
"lastName": "ZuwqLKNPFyIYSqNl",
"age": 13
}
]
}
```### @num(min, max)
Returns integer between ```min``` (inclusive) and ```max```### @str(min, max)
Returns string between ```min``` (inclusive) and ```max```### @word(count, maxWordLength = 8)
Returns string in sentence-like form with ```count``` words where each word can't be longer than ```maxWordLength```### @repeat
Return array with repeated object## Run server
```npm start```
## Run tests
```npm test```