Requirements:
- Go v1.20.3
- mysql
Run without docker:
- Run
go mod tidy - Run
go mod vendor - Add .env file with example from .env.example
- Run go install -tags 'mysql,postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
- Run migrate -database "mysql://{mysql_user}:{mysql_passwor}@tcp({mysql_host}:{mysql_port})/{database_name}" -path db/migrations up (Change all variables inside {} to your mysql variables)
- If you have install Make then run
make dev - If you haven't installed Make then run
go build -o bin/todo app/main.gothen./bin/todo
Requirements:
- Docker & Docker Compose
Run with docker
- Add .env file with example from .env.example
- Run
docker-compose up --buildormake docker-build - If you already run
docker-compose up --buildthen for after that you can just rundocker-compose upormake docker-up