diff options
| author | Xe Iaso <me@xeiaso.net> | 2025-01-19 19:55:35 -0500 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2025-01-19 19:55:35 -0500 |
| commit | 66c77d2f009eef162775c4cbc9fd6c394c5f3672 (patch) | |
| tree | 4fd795a669532aa2a4f743e6e64ad89d6e9e7c05 /cmd/httpdebug | |
| parent | 3bdea367a52de3c0cc94a0b63348206ed7d30d9c (diff) | |
| download | x-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.go | 25 |
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) + }, + ))) +} |
