Just a basic REST API using Gin and GORM
You'll need to have go installed in your system to run the app with this method.
cd
to the app directory- Don't forget to add your environment variables (copy .env.sample to .env file and modify)
- Run following command on your terminal
go run main.go
go build -o main . && ./main
Alternatively, you can also run the app using docker. The Dockerfile
is already present in the project.
docker run --rm -it $(docker build -q .)
docker build -t <TAG_NAME> .
and run it
docker run -d <TAG_NAME>
Don't forget to replace <TAG_NAME>
with the name of your choice.
You need to install air for hot-reload support. Follow their documentation to install in on your system. Once it is installed, just run this command:
air