https://github.com/ega4432/go-rest-api-docker
https://github.com/ega4432/go-rest-api-docker
air api docker docker-compose go go-rest-api-docker golang mysql rest rest-api
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ega4432/go-rest-api-docker
- Owner: ega4432
- License: mit
- Created: 2022-07-16T05:38:43.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-19T13:16:53.000Z (about 3 years ago)
- Last Synced: 2025-05-31T20:50:13.548Z (about 1 year ago)
- Topics: air, api, docker, docker-compose, go, go-rest-api-docker, golang, mysql, rest, rest-api
- Language: Go
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-rest-api-docker
[](https://github.com/ega4432/go-rest-api-docker/actions/workflows/ci.yaml)
## Overview
This repository is a template for a Todo application in the Golang that can run on any platform as long as Docker is running.
MySQL is used as the data store.
## Endpoints
Method | Path | Description
--- | --- | ---
GET | `/tasks` | Get all tasks |
POST | `/tasks` | Create a new task |
GET | `/tasks/{id}` | Get a task |
PUT | `/tasks/{id}` | Update a task |
DELETE | `/tasks/{id}` | Delete a task |
## Usage
```shell
$ git clone git@github.com:ega4432/go-rest-api-docker.git && cd go-rest-api-docker
$ cp .env.example .env
$ docker compose up --build
```
## Tips
### Connect db container
```shell
$ docker compose exec -it db /bin/bash -c "mysql -uroot -p"
```
### Import API test file with Thunder client
1. Install extension from [here](https://marketplace.visualstudio.com/items?itemName=rangav.vscode-thunder-client)
2. Import [JSON file](https://github.com/ega4432/go-rest-api-docker/blob/main/.vscode/thunder-collection_go-rest-api-docker.json)