https://github.com/alextanhongpin/go-rest-api
Golang + MySql REST api
https://github.com/alextanhongpin/go-rest-api
go golang rest-api
Last synced: over 1 year ago
JSON representation
Golang + MySql REST api
- Host: GitHub
- URL: https://github.com/alextanhongpin/go-rest-api
- Owner: alextanhongpin
- Created: 2017-05-21T16:07:58.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-02T09:25:11.000Z (about 9 years ago)
- Last Synced: 2025-01-29T21:54:19.295Z (over 1 year ago)
- Topics: go, golang, rest-api
- Language: Go
- Size: 1.44 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang REST API with MySQL
MySQL Community Server 5.7.18 + go v1.8.1
## Deployment
```bash
$ docker run --rm -it -v "$GOPATH":/gopath -v "$(pwd)":/app -e "GOPATH=/gopath" -w /app golang:1.4.2 sh -c 'CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o your_binary_name'
```
## Run Docker MySql
```bash
$ docker run --rm --name demo-mysql -it -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql
```
```bash
$ docker exec -it some-mysql bash
```
## Running a local example without docker
```bash
$ go run main.backup.go
```