Serving index.html

This commit is contained in:
2025-03-11 16:53:09 +02:00
parent dc1cbd2dc6
commit d324deef96
4 changed files with 33 additions and 0 deletions

21
main.go Normal file
View File

@@ -0,0 +1,21 @@
package main
import (
"net/http"
)
func main() {
mux := http.NewServeMux()
mux.Handle("/", http.FileServer(http.Dir("./public")))
server := &http.Server{
Addr: ":8080",
Handler: mux,
}
// Start the server
if err := server.ListenAndServe(); err != nil {
panic(err)
}
}