all repos — flounder @ b4a35f3a09684d4186607380551ba803b06f9f3f

A small site builder for the Gemini protocol

main.go (view raw)

 1package main
 2
 3import (
 4    "fmt"
 5    "log"
 6    "net/http"
 7)
 8
 9func handler(w http.ResponseWriter, r *http.Request) {
10    fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
11}
12
13func main() {
14    http.HandleFunc("/", handler)
15    log.Fatal(http.ListenAndServe(":8080", nil))
16}