Migrated project to use golang.
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user