webweav.ing/cmd/web/routes.go

18 lines
393 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)
2024-03-03 21:05:19 +00:00
r.Get("/feedgen", app.feedgenView)
r.Get("/feedgen/generate", app.generateRss)
2024-01-19 03:33:37 +00:00
return r
}