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: 7 months 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 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-09T13:59:52.000Z (over 4 years ago)
- Last Synced: 2025-01-12T06:07:12.669Z (9 months 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`

* * *
### Create event
**POST:** `http://localhost:8080/events`
```json
{
"Id": "2",
"title": "New event",
"description": "New event description"
}
```
* * *
### Get event by ID
**GET:** `http://localhost:8080/events/{id}`

* * *
### Get all events
**GET:** `http://localhost:8080/events` (all events)

* * *
### Update event
**PATCH:** `http://localhost:8080/events/{id}`
```json
{
"title": "Update event",
"description": "Update event description"
}
```
* * *
### Delete event
**DELETE:** `http://localhost:8080/events/{id}`
