Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sph3ricalpeter/go-service-base
A simple (almost minimal) service written in GO with a multistage docker build & 15MB container size
https://github.com/sph3ricalpeter/go-service-base
Last synced: 12 days ago
JSON representation
A simple (almost minimal) service written in GO with a multistage docker build & 15MB container size
- Host: GitHub
- URL: https://github.com/sph3ricalpeter/go-service-base
- Owner: Sph3ricalPeter
- License: mit
- Created: 2024-03-06T18:02:33.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-06T18:41:21.000Z (9 months ago)
- Last Synced: 2024-04-28T04:17:26.781Z (7 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple GO Service
A simple (almost minimal) service written in GO with a multistage docker build & 15MB container size
## Usage
Simply run the following command to start the service:
```shell
docker compose up --build
```There's an endpoint `/alive`:
```shell
curl http://localhost:8080/alive
# prints out '{"message":"Yo I'm alive!"}'
```Calling the endpoint will print:
```text
2024/10/10 22:55:27 "GET http://localhost:8080/alive HTTP/1.1" from 172.18.0.1:60952 - 200 24B in 40.452µs
```Endpoint `/private` requires an api key header, default is `123123`
```shell
curl -X GET "localhost:8080/private" -w "%{http_code}"
# prints out '401'curl -X GET "localhost:8080/private" -H "X-API-KEY: 123123"
# prints out '{"message":"I'm private!"}'
```