aboutsummaryrefslogtreecommitdiff
path: root/cmd/httpdebug
diff options
context:
space:
mode:
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)
+ },
+ )))
+}