From 66c77d2f009eef162775c4cbc9fd6c394c5f3672 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sun, 19 Jan 2025 19:55:35 -0500 Subject: cmd: add httpdebug Signed-off-by: Xe Iaso --- cmd/httpdebug/main.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 cmd/httpdebug/main.go (limited to 'cmd/httpdebug') diff --git a/cmd/httpdebug/main.go b/cmd/httpdebug/main.go new file mode 100644 index 0000000..8d61c03 --- /dev/null +++ b/cmd/httpdebug/main.go @@ -0,0 +1,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) + }, + ))) +} -- cgit v1.2.3