This is simple app to add and get "users"
Backend: Golang with few frameworks: go-macaron, sirupsen/logrus, jmoiron/sqlx
Frontend: Bootstrap 4.3.1 + jquery 3.6.0
Build: Go binary / Docker
CI/CD: GitHub actions
Environment: EC2 instances with ELB + Mysql-RDS (Infrastructure diagram)
test
- Specify environment variables -
APP_VERSION
,DB_URL
,DB_USERNAME
,DB_PASSWORD
,DOCKER_REGISTRY_URL
#example values:
APP_VERSION=0.2.0
DB_URL=localhost:3306
DB_USERNAME=root
DB_PASSWORD=supersecret
- Start mysql instance
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=${DB_PASSWORD} -v ${PWD}:/var/lib/mysql -p 3306:3306 mysql:5.7.33 --innodb_rollback_on_timeout=1
- Build and run
docker build -t myservice:${APP_VERSION} .
docker run --name myservice -p 80:4000 myservice:${APP_VERSION}
- Send GET / POST requests to check
# create user example
curl -XPOST http://localhost/api/v1/users -H "Content-Type: application/json" -d '{"name":"test2","email":"test@mail.com"}'
# get user by name example
curl -XGET http://localhost/api/v1/users?name=test2
Thanks for considering contributing! There’s information about how to get started with Myservice here.
When PR will be created - new AWS test environment will be ready in around 20 minutes. You will get link to test web service from github-bot in PR comments.
After closing PR by any reason - test environment will be destroyed
Copyright © 2021 Denis Lavrushko