A small, well-structured Go HTTP server and companion HTTP client.
Go module: github.com/rahilsh/go-server (requires Go 1.25+)
cmd/
server/ # HTTP server entrypoint
client/ # HTTP client entrypoint
internal/
server/ # routes, handlers, server setup (testable core)
make build # -> bin/server, bin/client
make run # run the server (default :3000)
make run-client # run the clientOr directly:
go run ./cmd/server
go run ./cmd/client| Variable | Default | Used by |
|---|---|---|
SERVER_ADDR |
:3000 |
server |
CLIENT_URL |
https://jsonplaceholder.typicode.com/todos/1 |
client |
curl localhost:3000/ # -> Hello world!
curl localhost:3000/books # -> {"total":0,"count":0,"books":[]}make test # go test -race ./...
make test-cover # coverage report
make lint # golangci-lint
make vet # go vet
make fmt # gofmt -w .make docker
docker run --rm -p 3000:3000 go-server:latest