An open API service indexing awesome lists of open source software.

https://github.com/prawee/node-simulator-api-server

simulator api for client test
https://github.com/prawee/node-simulator-api-server

api-server nodejs simulator-api

Last synced: about 1 month ago
JSON representation

simulator api for client test

Awesome Lists containing this project

README

          

#Clone and Install
Clone
```
cd /var/www/
git clone https://github.com/prawee/node-simulator-api-server.git json-server
cd json-server
```
Install Package
```
npm install
or
npm i
```

#Run
```
json-server --watch faker.js
or
json-server --w faker.js
```

#View
open your browser and then
http://localhost:3000/users

#RESTFul
POST
```
curl -X POST -H "Content-type: application/json" localhost:3000/users -d '{"name": "Prawee Wongsa" }'
```
```
{
"name": "Prawee Wongsa",
"id": 51
}
```
GET (all)
```
curl -X GET -H "Content-type: application/json" localhost:3000/users
```
GET (some)
```
curl -X GET -H "Content-type: application/json" localhost:3000/users/51
```
```
{
"name": "Prawee Wongsa",
"id": 51
}
```
DELETE
```
curl -X DELETE -H "Content-type: application/json" localhost:3000/users/51
```
```
{}
```

#More Information about Tools
https://github.com/typicode/json-server