// vim: shiftwidth=4 tabstop=4 noexpandtab package main import ( "fmt" "log" "net/http" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" ) const ( APP_DATA = "/usr/share/birdscan" ) func runServer() { router := chi.NewRouter() router.Use(middleware.Logger) router.Get("/", indexHandler) log.Println("Binding to 'http://" + "127.0.0.1" + ":" + "8080" + "'") log.Fatal(http.ListenAndServe("127.0.0.1" + ":" + "8080", router)) } func indexHandler(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, fmt.Sprintf("%s/html/index.html", APP_DATA)) }