aboutsummaryrefslogtreecommitdiff
path: root/cmd/httpdebug/main.go
blob: 8d61c03f12f21e0cf149f47a6cae934940a967fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main

import (
	"flag"
	"log"
	"log/slog"
	"net/http"

	"within.website/x/internal"
)

var (
	bind = flag.String("bind", ":3000", "TCP port to bind to")
)

func main() {
	internal.HandleStartup()

	slog.Info("listening", "url", "http://localhost"+*bind)
	log.Fatal(http.ListenAndServe(*bind, http.HandlerFunc(
		func(w http.ResponseWriter, r *http.Request) {
			r.Write(w)
		},
	)))
}