https://github.com/thepatrik/hellohttp
A simple barebone HTTP server implementation in golang.
https://github.com/thepatrik/hellohttp
api go golang http
Last synced: 3 months ago
JSON representation
A simple barebone HTTP server implementation in golang.
- Host: GitHub
- URL: https://github.com/thepatrik/hellohttp
- Owner: thepatrik
- License: mit
- Created: 2020-05-01T04:30:13.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-03T07:33:46.000Z (almost 6 years ago)
- Last Synced: 2024-06-20T16:48:37.588Z (almost 2 years ago)
- Topics: api, go, golang, http
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hellohttp
[](https://travis-ci.org/thepatrik/hellohttp) [](https://goreportcard.com/report/github.com/thepatrik/hellohttp) [](https://godoc.org/github.com/thepatrik/hellohttp)
A simple barebone HTTP server implementation in golang, that uses [chi](https://github.com/go-chi/chi) as a router with cors, compression, and logging middlewares enabled.
```bash
$ go run .
Running HTTP server on :8080
```
Check the health endpoint.
```bash
curl http://localhost:8080/health
OK
```
#### Docker
The Dockerfile is built from scratch and produces a small image (~8.1 MB).
Build with:
```bash
$ docker build -t hellohttp .
```
Run with:
```bash
$ docker run -p 8080:8080 hellohttp
```
#### Environment variables
The following environment variables are available (use a .env file for convenience).
| Name | Default | Description |
| ---- | ------- | ----------- |
| PORT | 8080 | Port number |