https://github.com/tkc/go-echo-server-sandbox
A scaffold of golang web server using labstack/echo
https://github.com/tkc/go-echo-server-sandbox
boilerplate echo golang gorm labstack-echo sandbox scaffold web-app webserver
Last synced: 11 months ago
JSON representation
A scaffold of golang web server using labstack/echo
- Host: GitHub
- URL: https://github.com/tkc/go-echo-server-sandbox
- Owner: tkc
- Created: 2016-08-10T07:35:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-04-05T08:59:54.000Z (almost 6 years ago)
- Last Synced: 2025-05-09T01:47:23.238Z (11 months ago)
- Topics: boilerplate, echo, golang, gorm, labstack-echo, sandbox, scaffold, web-app, webserver
- Language: Go
- Homepage:
- Size: 78.1 KB
- Stars: 13
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# go-echo-server-sandbox
echo server sandbox using ORM mapper and html template.
- github.com/labstack/echo
- github.com/jinzhu/gorm
- github.com/pilu/fresh
- github actions
## Requirements
### Go
```
$ brew install goenv
$ goenv install 1.13.x
$ goenv global 1.13.x
$ goenv rehash
```
## Dependency
```sh
$ make dep
```
## Install golangci-lint
```
$ brew install golangci/tap/golangci-lint
$ brew upgrade golangci/tap/golangci-lint
```
[more...](https://github.com/golangci/golangci-lint#macos)
## Lint
```
$ golangci-lint run
```
## Database (MySQL) Config
`note: cp config.yaml.example config.yaml`
update database config
``` yaml
app: local
port: :8080
database:
name:
name:
password:
```
## Migration
``` sh
$ go run ./migrate/migrate.go
```
## Serve and Hot Reload
``` sh
$ fresh
```
## Create New User
``` sh
$ curl http://localhost:8080/user \
-X POST \
-H "Content-Type: application/json" \
-d '{"Name": "userName","Age": 1}'
```
## Testing
``` sh
$ go test ./...
```