Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aaronzi/go-demo-api
Demo Web API written in GO including MySQL database connection and CRUD operations
https://github.com/aaronzi/go-demo-api
api crud go mysql rest web
Last synced: 8 days ago
JSON representation
Demo Web API written in GO including MySQL database connection and CRUD operations
- Host: GitHub
- URL: https://github.com/aaronzi/go-demo-api
- Owner: aaronzi
- License: mit
- Created: 2024-07-14T09:29:31.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-05T12:27:55.000Z (about 1 month ago)
- Last Synced: 2024-12-05T13:26:56.896Z (about 1 month ago)
- Topics: api, crud, go, mysql, rest, web
- Language: Go
- Homepage: https://hub.docker.com/r/aaronzi/go-demo-api
- Size: 8.46 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Demo API
## Getting Started
You can clone this repository by running the following command:
```bash
git clone https://github.com/aaronzi/go-demo-api.git
```After you cloned the repository, open the folder in vscode.
It will automatically detect the devscontainer configuration and ask you to reopen the folder in the container.
This also inmcludes the database container.From the debug menu, you can run the API by selecting the `Launch Server` configuration.
## Using the Docker Image
You can use the Docker Image from either Docker Hub or GitHub Container Registry.
You can find the Docker Image on Docker Hub [here](https://hub.docker.com/r/aaronzi/go-demo-api) and on GitHub Container Registry on the following link [here](https://github.com/aaronzi/go-demo-api/packages).In order to run the Docker Image, you should use it together with mysql:latest running in the same docker network or in the same docker-compose file.
## Rebuild the Swagger Documentation
To build the Swagger documentation, run the following command:
```bash
swag init -g cmd/movie-api/main.go --parseDependency --parseInternal -o docs
```This will generate the `docs` directory with the Swagger documentation.
> **Note:** You should run this command every time you make changes to the API.