Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/symfa-inc/meals-api
- Owner: Symfa-Inc
- Created: 2020-08-05T12:13:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-05T02:24:22.000Z (almost 2 years ago)
- Last Synced: 2024-03-20T19:12:58.262Z (11 months ago)
- Language: Go
- Size: 2.77 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
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
```