https://github.com/moonman369/go-crud-api
This a Go Based CRUD-API Endpoint
https://github.com/moonman369/go-crud-api
ba backend clevercloud crud-api go gomodule web-server
Last synced: about 1 year ago
JSON representation
This a Go Based CRUD-API Endpoint
- Host: GitHub
- URL: https://github.com/moonman369/go-crud-api
- Owner: moonman369
- Created: 2023-07-17T13:25:06.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T08:45:22.000Z (almost 3 years ago)
- Last Synced: 2025-01-17T13:31:24.185Z (over 1 year ago)
- Topics: ba, backend, clevercloud, crud-api, go, gomodule, web-server
- Language: Go
- Homepage: https://go-crud-api.cleverapps.io/
- Size: 7.57 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**This is a Go based CRUD API to store and process movies**
# API Documentation
### 1. GET ALL MOVIES
- Base URL: `https://go-crud-api.cleverapps.io`
- Endpoint: `/movies`
- Method: `GET`
- Example Response:
```
200 OK
[
{
"id": "2",
"isbn": "831479",
"title": "Inception",
"director": {
"firstName": "Christopher",
"lastName": "Nolan"
}
},
{
"id": "3",
"isbn": "15740661",
"title": "Avatar",
"director": {
"firstName": "James",
"lastName": "Cameron"
}
}
]
```
### 2. GET MOVIE BY ID
- Base URL: `https://go-crud-api.cleverapps.io`
- Endpoint: `/movies/[id: numeric string]`
- Method: `GET`
- Example Request: `/movies/2`
- Example Successful Response:
```
200 OK
{
"id": "2",
"isbn": "831479",
"title": "Inception",
"director": {
"firstName": "Christopher",
"lastName": "Nolan"
}
}
```
- Example Unsuccessful Response: `404 NOT FOUND`
### 3. CREATE MOVIE
- Base URL: `https://go-crud-api.cleverapps.io`
- Endpoint: `/movies`
- Method: `POST`
- Example Request Body:
```
{
"title": "movie_name",
"director": {
"firstName": "director_first_name",
"lastName": "director_last_name"
}
}
```
- Example Successful Response:
```
200 OK
{
"id": "3", // plain counter
"isbn": "831479", //random
"title": "movie_name",
"director": {
"firstName": "director_first_name",
"lastName": "director_last_name"
}
}
```
### 4. UPDATE MOVIE
- Base URL: `https://go-crud-api.cleverapps.io`
- Endpoint: `/movies/[id: numeric string]`
- Method: `PUT`
- Exmaple Request Query: `/movies/4`
- Example Request Body:
```
{
"title": "updated_movie_name",
"director": {
"firstName": "updated_director_first_name",
"lastName": "updated_director_last_name"
}
}
```
- Example Successful Response:
```
200 OK
{
"id": "4", // unchanged
"isbn": "831479", // unchanged
"title": "updated_movie_name",
"director": {
"firstName": "updated_director_first_name",
"lastName": "updated_director_last_name"
}
}
```
- Example Unsuccessful Response: `404 NOT FOUND`
### 5. DELETE MOVIE
- Base URL: `https://go-crud-api.cleverapps.io`
- Endpoint: `/movies/[id: numeric string]`
- Method: `DELETE`
- Exmaple Request Query: `/movies/4`
- Example Successful Response: `200 OK`
- Example Unsuccessful Response: `404 NOT FOUND`