- commit
- 682ca66fd153ac09843bdd82db3724d0b5fd8f85
- parent
- efa2bbd791979c9639eec3753a24aff656ca0b58
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2026-10-24 14:49
port as int
Diffstat
| M | audiothek.go | 6 | +++--- |
1 files changed, 3 insertions, 3 deletions
diff --git a/audiothek.go b/audiothek.go
@@ -333,18 +333,18 @@ func handleSearch(w http.ResponseWriter, r *http.Request) {
333 333 }
334 334
335 335 func main() {
336 -1 port := "8000"
-1 336 port := 8000
337 337
338 338 flag.Usage = func() {
339 339 fmt.Fprintf(os.Stderr, "audiothek [-p PORT] [-o ORIGIN]\n")
340 340 flag.PrintDefaults()
341 341 }
342 342
343 -1 flag.StringVar(&port, "p", "8000", "port")
-1 343 flag.IntVar(&port, "p", 8000, "port")
344 344 flag.StringVar(&origin, "o", "", "origin for links")
345 345 flag.Parse()
346 346
347 -1 addr := fmt.Sprintf("localhost:%s", port)
-1 347 addr := fmt.Sprintf("localhost:%d", port)
348 348
349 349 http.HandleFunc("/", handle)
350 350 http.HandleFunc("/search/", handleSearch)