Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillaumefalourd/poc-rest-api-golang
POC of a REST API with an event CRUD using gorilla/mux in Golang 🐿
https://github.com/guillaumefalourd/poc-rest-api-golang
crud golang poc rest-api
Last synced: 3 days ago
JSON representation
POC of a REST API with an event CRUD using gorilla/mux in Golang 🐿
- Host: GitHub
- URL: https://github.com/guillaumefalourd/poc-rest-api-golang
- Owner: GuillaumeFalourd
- License: apache-2.0
- Created: 2021-06-08T17:08:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-09T13:59:52.000Z (over 3 years ago)
- Last Synced: 2024-10-12T14:38:45.495Z (about 1 month ago)
- Topics: crud, golang, poc, rest-api
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# poc-rest-api-golang
## Description
POC of a _REST API_ with an **event CRUD** using [gorilla/mux](https://github.com/gorilla/mux) (a powerful HTTP router and URL matcher for building Go web servers).
## Prerequisites
### Golang
- Go installed
- GOPATH configured### Dependency
- `go get -u github.com/gorilla/mux`
## How to use?
On the repo directory, run: `go run main.go`, then consume the services below on your Rest Client tool.
## Services
### Hello World
**GET:** `http://localhost:8080`
![hello-world](https://user-images.githubusercontent.com/22433243/121230719-fa359600-c865-11eb-93f4-eeb48f1cf586.png)
* * *
### Create event
**POST:** `http://localhost:8080/events`
```json
{
"Id": "2",
"title": "New event",
"description": "New event description"
}
```![create event](https://user-images.githubusercontent.com/22433243/121230734-002b7700-c866-11eb-96d9-8232a54b42ec.png)
* * *
### Get event by ID
**GET:** `http://localhost:8080/events/{id}`
![get event](https://user-images.githubusercontent.com/22433243/121230759-07528500-c866-11eb-95ba-3a40fd2a6463.png)
* * *
### Get all events
**GET:** `http://localhost:8080/events` (all events)
![all events](https://user-images.githubusercontent.com/22433243/121230781-0d486600-c866-11eb-9f53-424e8529170d.png)
* * *
### Update event
**PATCH:** `http://localhost:8080/events/{id}`
```json
{
"title": "Update event",
"description": "Update event description"
}
```![update event](https://user-images.githubusercontent.com/22433243/121230798-12a5b080-c866-11eb-835e-5a2212ae4387.png)
* * *
### Delete event
**DELETE:** `http://localhost:8080/events/{id}`
![delete event](https://user-images.githubusercontent.com/22433243/121230820-1802fb00-c866-11eb-9474-ea4acf3214ad.png)