aboutsummaryrefslogtreecommitdiff
path: root/cmd/httpdebug
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-01-19 19:55:35 -0500
committerXe Iaso <me@xeiaso.net>2025-01-19 19:55:35 -0500
commit66c77d2f009eef162775c4cbc9fd6c394c5f3672 (patch)
tree4fd795a669532aa2a4f743e6e64ad89d6e9e7c05 /cmd/httpdebug
parent3bdea367a52de3c0cc94a0b63348206ed7d30d9c (diff)
downloadx-66c77d2f009eef162775c4cbc9fd6c394c5f3672.tar.xz
x-66c77d2f009eef162775c4cbc9fd6c394c5f3672.zip
cmd: add httpdebug
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd/httpdebug')
-rw-r--r--cmd/httpdebug/main.go25
1 files changed, 25 insertions, 0 deletions
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)
+ },
+ )))
+}