Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dhyanio/simple-crud-apis
Golang simple crud apis
https://github.com/dhyanio/simple-crud-apis
Last synced: 20 days ago
JSON representation
Golang simple crud apis
- Host: GitHub
- URL: https://github.com/dhyanio/simple-crud-apis
- Owner: dhyanio
- Created: 2021-05-08T17:19:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-08T17:22:36.000Z (over 3 years ago)
- Last Synced: 2024-06-19T15:00:09.126Z (6 months ago)
- Language: Go
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### REST API in Go
Simple CRUD service for managing orders, written in Go.
***
### Setup and usage
```
cd to the project directory
``````go
go build go-orders-api
./go-orders-api
```Create Order
```shell
curl -H 'Content-Type: application/json' -d '{"orderedAt":"2019-11-09T21:21:46+00:00","customerName":"Tom Jerry","items":[{"itemId":"123","description":"IPhone 10X","quantity":1}]}' -X POST http://localhost:8080/orders
```Get Orders
```shell
curl http://localhost:8080/orders
```Update Order
```shell
curl -H 'Content-Type: application/json' -d '{"orderId":"1","orderedAt":"2019-11-09T21:21:46+00:00","items":[{"itemId":"123","description":"IPhone 10X","quantity":3}]}' -X PUT http://localhost:8080/orders/1
```Delete Order
```shell
curl -X DELETE http://localhost:8080/orders/1
```***
### TutorialYou can find the tutorial for this application at the [SoberKoder](https://www.soberkoder.com/) blog.
https://www.soberkoder.com/go-rest-api-gorilla-mux/