https://github.com/mathleite/simple-go-api
Simple CRUD api
https://github.com/mathleite/simple-go-api
api crud docker golang hacktoberfest mux
Last synced: about 2 months ago
JSON representation
Simple CRUD api
- Host: GitHub
- URL: https://github.com/mathleite/simple-go-api
- Owner: mathleite
- License: gpl-3.0
- Created: 2020-10-10T00:26:10.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-12T15:35:09.000Z (over 5 years ago)
- Last Synced: 2025-04-18T11:41:32.365Z (about 1 year ago)
- Topics: api, crud, docker, golang, hacktoberfest, mux
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Simple Go Api
## Setup
Just **build** docker with:
```bash
docker-compose up --build -d
```
## Server
To start:
* Enter inside `golang` container:
```bash
docker-compose exec golang bash
```
* Build and run serve
```go
go build && ./app
```
The server will be allocate on `http://localhost/api/books`
Config:
* Header: `Content-Type application/json`
## How it's works?
You can use:
- **POST** to create Books;
- **GET** to get Books and specific Book by **ID**;
- **DELETE** to delete Book by **ID**;
- **PUT** to update Book by **ID**
#### Example
**Create** Book:
```json
{
"isbn": "432432",
"title": "Andorinha",
"author": {
"firstname": "Carol",
"lastname": "Williams"
}
}
```