Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/symfa-inc/meals-api

Golang source code example
https://github.com/symfa-inc/meals-api

Last synced: about 1 month ago
JSON representation

Golang source code example

Awesome Lists containing this project

README

        

### Create .env file from .env.example
```
cp .env.example .env
```
___
### Install all Go dependencies
```
go get -v ./...
```
### Generate and update swagger docs
```
go get -u github.com/swaggo/swag/cmd/swag
swag init
```
### [How to describe swagger routes](https://github.com/swaggo/swag/blob/master/README.md)
#### [Examples](https://github.com/swaggo/swag/blob/master/example/celler/controller/examples.go)
### Dockerization
```
docker-compose up -d
```
___
### How to
##### Run migrations and seeds
```
go run db/migrate.go
```
##### Run tests
install godotenv on your machine
```
go get github.com/joho/godotenv/cmd/godotenv
```
and then run tests with godotenv command
```
godotenv go test ./... -count=1
```
use flag -count=1 to clear cache
##### Run linter
```
go fmt ./...
```
___
## Run project with live reload
```
go get -u github.com/cosmtrek/air
type "air" in your command-line
```
## Without live reload
```
go run main.go
```