godash/handlers/routes.go

17 lines
375 B
Go
Raw Normal View History

2024-03-12 15:49:08 +01:00
package handlers
import (
"net/http"
"github.com/r3labs/sse/v2"
)
2024-05-21 17:33:13 +02:00
func SetupRoutes(router *http.ServeMux, sse *sse.Server, appHandler *AppHandler) {
router.HandleFunc("GET /sse", sse.ServeHTTP)
2024-04-12 16:19:11 +02:00
2024-05-21 17:33:13 +02:00
fsAssets := http.FileServer(http.Dir("assets"))
router.Handle("GET /assets/", http.StripPrefix("/assets/", fsAssets))
2024-04-12 16:19:11 +02:00
2024-05-21 17:33:13 +02:00
router.HandleFunc("GET /", appHandler.appHandler)
2024-03-12 15:49:08 +01:00
}