daryanka / react-query-tut-crud-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API Documentation

Post Structure

{
  "id": "string - AUTO GENERATED - UNIQUE",
  "name": "string - REQUIRED", 
  "body": "string - REQUIRED"
}

GET /posts

returns array of all posts

GET /posts/:id

returns single post
returns error if post not found

POST /posts

create new post
returns created post
expects following JSON structure

{
  "name": "string - REQUIRED", 
  "body": "string - REQUIRED"
}

PUT /posts/:id

update existing post
returns updated post
expects following JSON structure

{
  "name": "string - REQUIRED", 
  "body": "string - REQUIRED"
}

DELETE /posts/:id

returns error false when successfully deleting post

About


Languages

Language:Go 100.0%