24 lines
463 B
Go
24 lines
463 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
"jh/website/internal/handlers"
|
|
)
|
|
|
|
func main() {
|
|
mux := http.NewServeMux()
|
|
|
|
// Resolve static dir relative to the binary's location
|
|
mux.Handle("GET /static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))
|
|
|
|
// Routes
|
|
mux.HandleFunc("GET /", handlers.Home)
|
|
|
|
log.Println("Server starting on http://localhost:8080")
|
|
if err := http.ListenAndServe(":8080", mux); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|