There is a simple webserver written in Go.
We use DDD (Domain Driven Design) to separate the domain logic from the application logic.
- The project uses the structure proposed in the book Go with domain
- moq for adapters mocking
- JSON Web Token
- chi router
- GitHub Actions
Run in docker (Recommended)
It’s simple to run it with docker. You don’t even need to clone the project to your repository:
docker run \ -e ADDRESS=0.0.0.0:8080 \ ghcr.io/f0rzend/simplegowebserver:master
There is also some environment variables you can set, to configure project. Read more about it in the docker documentation.
List of available environment variables above.
||Address to listen on||
Be carefully. If you want to run it on localhost in docker container,
you need to set
Build from source
Firstly you need to clone the project repository on your local machine:
git clone https://github.com/F0rzend/SimpleGoWebserver.git
Entry point is
Then you need to go to the project directory and build it:
cd SimpleGoWebserver && go build -o simplegowebserver cmd/api/main.go
Now you can run the project. You must be in the same folder as the binary and run the following command:
After this you will see the following message:
0:00AM INF cmd/api/main.go:27 > starting server on :8080
Run project via docker compose
You can run the project via docker compose. See the docker-compose.yml file.