Skip to main content
100%

Http example with Go

✓ Published0🌍 Public
WWilliamQLiu
Last edited Apr 28, 2016
Created on Apr 28, 2016

This Go example demonstrates a simple HTTP server with three route handlers that return plain-text responses. The code uses the `net/http` package's `NewServeMux` router to map URL paths (`/hello`, `/world`, and a catch-all `/`) to handler functions, each writing a short string via `io.WriteString` to the `http.ResponseWriter`. The server listens on port 8000, and the main function prints a startup message. No external libraries are used beyond Go's standard library.

AI-generated description

Similar vizzes