點燈坊

失くすものさえない今が強くなるチャンスよ

RESTful API by JSON Server

Sam Xiao's Avatar 2022-12-30

JSON Server provides simple RESTful API for GET、POST、PUT、PATCH、DELETE actions.

Version

JSON Server 0.17.1

GET

http://localhost:3000/posts
  • Get all posts.
http://localhost:3000/posts/1
  • Get post by id 1

POST

http://localhost:3000/posts
  • Add one post

PUT

http://localhost:3000/posts/1
  • Update post by id 1

PATCH

http://localhost:3000/posts/1
  • Partial update post by id 1

DELETE

http://localhost:3000/posts/1
  • Delete post id 1

Conclusion

  • We don’t have to write any code for RESTful API for development