https://github.com/classfunc/golang-api
API use Golang, CI/CD setting with Dockerfile, Goolge Cloud Build, Cloud Run
https://github.com/classfunc/golang-api
Last synced: about 1 year ago
JSON representation
API use Golang, CI/CD setting with Dockerfile, Goolge Cloud Build, Cloud Run
- Host: GitHub
- URL: https://github.com/classfunc/golang-api
- Owner: ClassFunc
- License: mit
- Created: 2022-08-04T08:23:06.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-14T05:51:30.000Z (over 2 years ago)
- Last Synced: 2025-02-10T03:47:34.963Z (about 1 year ago)
- Language: Go
- Size: 10.5 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
## Start API
```bash
# Install
go get .
# Run
go run .
or
go build -o server && ./server
```
## Test call api
```bash
curl --location --request GET 'http://localhost:8080/api/user/list'
// output
[
{
"id": "1-kenzo",
"name": "Kenzo",
"address": "Tokyo - Japan"
},
{
"id": "2-hinata",
"name": "Hinata",
"address": "Tokyo - Japan"
},
{
"id": "3-yumi",
"name": "Yumi",
"address": "Tokyo - Japan"
}
]
curl --location --request GET 'http://localhost:8080/api/user/get/2-hinata' \
--data-raw ''
// output
{
"id": "2-hinata",
"name": "Hinata",
"address": "Tokyo - Japan"
}
```
## Test build on docker
```html
- Install docker: https://docs.docker.com/get-docker/
- Build docker images command: docker build -t api-brother .
- Run docker images command: docker run api-brother
- List images : docker images
```