-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
28 lines (24 loc) · 795 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main
import (
"log"
"net/http"
"tracker/handlers"
)
func main() {
// Map URLs to their respective page handlers
http.HandleFunc("/", handlers.HomeHandler)
http.HandleFunc("/relations", handlers.RelationHandler)
http.HandleFunc("/locations", handlers.LocationHandler)
http.HandleFunc("/dates/", handlers.DatesHandler)
http.HandleFunc("/artistProfile", handlers.ArtistDetails)
http.HandleFunc("/artist", handlers.ArtistHandler)
// Serve static files (CSS, images)
fileServer := http.FileServer(http.Dir("./static/"))
http.Handle("/static/", http.StripPrefix("/static/", fileServer))
// Start the server
log.Println("Server running at http://localhost:8082")
err := http.ListenAndServe(":8082", nil)
if err != nil {
log.Fatal("Failed to start the server:", err)
}
}