REST API built from scratch with a MySQL database
1.) Add and configure the .env
file in the root directory :
scratch-api
โโโ api
โโโ bin
โโโ scripts
โโโ storage
โโโ types
โโโ .env <--- create .env file
โโโ .gitignore
โโโ docker-compose.yml
โโโ go.mod
โโโ go.sum
โโโ main.go
โโโ Makefile
# .env
DB_PASSWORD="YourDatabasePassword123"
2.) Create and run mysql server
- ensure docker is installed on your machine
docker-compose up --build -d
- ensure make is installed on your system:
// linux
sudo apt-get install build-essential
// windows (assuming you already have choco installed)
choco install make
- Run API
make run