Files
crowsnest/cmd/frontend/main.go

21 lines
407 B
Go
Raw Normal View History

2024-12-20 01:15:56 +01:00
package main
import (
"crowsnest/internal/routes"
"net/http"
2024-12-20 01:15:56 +01:00
)
2025-01-02 00:35:41 +01:00
2024-12-20 01:15:56 +01:00
func main() {
// routes
http.HandleFunc("GET /", routes.Index)
http.HandleFunc("POST /up/search", routes.UpSearch)
2024-12-20 01:15:56 +01:00
// serve files from the "static" directory
2025-01-02 15:13:13 +01:00
fs := http.FileServer(http.Dir("web/static"))
http.Handle("GET /static/", http.StripPrefix("/", fs))
2024-12-20 01:15:56 +01:00
// start server
http.ListenAndServe(":8080", nil)
2024-12-20 01:15:56 +01:00
}