rentease/internal/server/routes.go
2024-02-16 20:36:46 +01:00

14 lines
548 B
Go

package server
func (s Server) MountHandlers() {
// landing page
s.Router.GET("/", handleHomePage())
s.Router.GET("/bookings", handleListBookingPage(s.bs))
s.Router.GET("/bookings/new", handleNewBookingPage())
s.Router.POST("/bookings/new", handleCreateBooking(s.bs))
s.Router.GET("/bookings/:id", handleBookingPage(s.bs))
s.Router.POST("bookings/:id/items", handleCreateItem(s.bs))
s.Router.GET("/reports", handleReportsPage())
s.Router.GET("/reports/do", handleComputeReport(s.bs))
s.Router.GET("/pdf", handleCreateInvoicePdf(s.ps))
}