hands on repo to test everything
A simple Go web server application demonstrating REST API endpoints, JSON responses, and containerization.
- Simple HTTP Web Server: Built using Go's standard
net/httppackage - REST API Endpoints:
GET /- Welcome messageGET /api/hello- Hello greeting (supports?name=query parameter)GET /health- Health check with uptime information
- JSON Responses: All endpoints return JSON formatted responses
- Request Logging: Logs all incoming requests with timestamps
- Docker Support: Containerized application ready for deployment
- Make Automation: Makefile for easy building, testing, and deployment
hello-web-server/
├── main.go # Main application with HTTP handlers
└── go.mod # Go module definition
Dockerfile # Docker image configuration
Makefile # Build automation
- Go 1.24 or later
- Docker (optional, for containerization)
- curl (for testing)
# Build the project
make build
# Prepare artifacts for deployment
make prepare-artifacts# Run locally
make run
# Or run directly with Go
cd hello-web-server && go run main.goThe server will start on http://localhost:8080
# Test all endpoints (server must be running)
make test
# Or test manually:
curl http://localhost:8080/
curl http://localhost:8080/api/hello
curl http://localhost:8080/api/hello?name=Developer
curl http://localhost:8080/health# Build the binary
make build
# Prepare artifacts
make prepare-artifacts
# Build Docker image
docker build -t hello-web-server:latest .
# Run the container
docker run -p 8080:8080 hello-web-server:latestmake cleanThis project is similar in structure to the hello_go project but takes a different approach:
| Aspect | hello_go | hello-web-server |
|---|---|---|
| Purpose | Structured logging demonstration | HTTP web server with REST API |
| Libraries | dazl (third-party logging) | Standard library (net/http) |
| Main Feature | Various log levels and formats | HTTP endpoints with JSON responses |
| Configuration | YAML logging config | No external config needed |
| Output | Console logs | HTTP responses + request logs |
| Use Case | Learning structured logging | Building simple web services |
GET /
{
"message": "Welcome to Hello Web Server! Visit /api/hello for a greeting.",
"status": "success",
"timestamp": "2026-02-12T09:08:00Z"
}GET /api/hello?name=Developer
{
"message": "Hello, Developer!",
"status": "success",
"timestamp": "2026-02-12T09:08:00Z"
}GET /health
{
"status": "healthy",
"uptime": "5m30s",
"timestamp": "2026-02-12T09:08:00Z"
}