webweav.ing/cmd/web/routes.go

17 lines
346 B
Go
Raw Normal View History

2024-01-19 03:33:37 +00:00
package main
import "net/http"
import "github.com/go-chi/chi"
func (app *application) routes() http.Handler {
r := chi.NewRouter()
fileServer := http.FileServer(http.Dir("./ui/static"))
r.Handle("/static/*", http.StripPrefix("/static", fileServer))
r.Get("/", app.home)
r.Get("/generate", app.generateRss)
return r
}