comparison serve.go @ 83:d8c30f64e301 draft

何をしていたか忘れてしまった Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
author yakumo.izuru
date Tue, 26 Mar 2024 02:18:06 +0000
parents e1f9fda6986a
children 01ae2ad18ed1
comparison
equal deleted inserted replaced
82:1b27391363d1 83:d8c30f64e301
31 31
32 // This function is called by the `aya serve` subcommand 32 // This function is called by the `aya serve` subcommand
33 func HttpServe(Dir string, Port int) { 33 func HttpServe(Dir string, Port int) {
34 handler := &Handler{http.FileServer(http.Dir(Dir))} 34 handler := &Handler{http.FileServer(http.Dir(Dir))}
35 http.Handle("/", handler) 35 http.Handle("/", handler)
36 addr := fmt.Sprintf(":%d", Port) 36 addr := fmt.Sprintf("127.0.0.1:%d", Port)
37 log.Printf("Listening on %s\n", addr) 37 log.Printf("[aya.HttpServe] Listening on %s\n", addr)
38 log.Fatal(http.ListenAndServe(addr, nil)) 38 log.Fatal(http.ListenAndServe(addr, nil))
39 } 39 }