Go Basic Webserver
Go web server using net/http with health endpoint and Docker support
A minimal web server using Go's standard net/http package with a health check endpoint. Includes Docker multi-stage build, Kubernetes deployment manifests, and GitHub Actions CI/CD workflow.
terchrisPrerequisites
Files
Files (9)
├── .dockerignore ├── .gitignore ├── Dockerfile ├── README-golang-basic-webserver.md ├── template-info.yaml ├── .github/ │ └── workflows/ │ └── urbalurba-build-and-push.yaml ├── app/ │ └── main.go └── manifests/ ├── deployment.yaml └── kustomization.yaml
Related templates
①What gets set up
When you install this template, the following are configured for you:
- Installs Go runtime, common tools, and VS Code extensions for Go development.
②Run the Go server
go run main.goServer runs on port 3000. VS Code auto-forwards the port.
Architecture
These diagrams are auto-generated from the template's metadata. Click any diagram to enlarge.
Deployment
Components
Template README
The Go Basic Webserver template is a simple hello world app using Go's standard library that displays "Hello world" on a web page. The purpose of this simple app is to verify that the development environment is set up and ready. See more documentation at http://localhost:3000/docs/templates/basic-web-server/golang-basic-webserver
HTTP API
| Path | Method | Response |
|---|---|---|
/ | GET | Plain text: greeting, template id golang-basic-webserver, and current time/date |
There is no separate health route in the default code.
Entry point and port
- File:
app/main.go - Port: 3000 (string in
main, passed toListenAndServe)
Development
- Run:
go run app/main.go - There is no hot reload — stop and re-run after edits.
Changing the app
- Register more handlers with
http.HandleFunc(or a router) beforeListenAndServe.