Skip to content

manhhungit-37/tony-json-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOYN JSON SERVER FAKE API FOR COUSRE FRONT END

Scripts

# run localhost:4000
$ npm run dev

# generate data
$ npm run generate-data
# refer: https://www.npmjs.com/package/json-server
# fetch api

Routes

API: https://tony-json-server.herokuapp.com/

# GET LIST
GET     /api/users
GET     /api/todos

# PAGINATION
GET     /api/users?_page=1&_limit=10
GET     /api/todos?_page=1&_limit=10

# DELETE
DELETE  /api/users/{userId}
DELETE  /api/todos/{todoId}

# UPDATE
# user
PATCH   /api/users/{userId}
Content-Type: application/json

{
  "phone": "090734232",
  "address": "Nguyen Trai"
}

# todo
PATCH   /api/todos/{todoId}
Content-Type: application/json

{
  "description": "sequi rerum inventore",
  "severity": "low",
  "status": "open",
}

# ADD NEW
# user
POST    /api/users
Content-Type: application/json

{
  "name": "Leanne Graham 1",
  "email": "[email protected]"
}

# todo
POST    /api/todos
Content-Type: application/json

{
  "userId": {userId},
  "description": "sequi rerum inventore",
  "severity": "low",
  "status": "open",
}

About

Create a api fake for Course Front End

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%