generate pie chart templ
This commit is contained in:
13
cmd/main.go
13
cmd/main.go
@@ -27,6 +27,10 @@ func main() {
|
||||
return c.Redirect(http.StatusMovedPermanently, "/landing_page/")
|
||||
})
|
||||
|
||||
app.GET("/pie_chart", func(c echo.Context) error {
|
||||
return c.Redirect(http.StatusMovedPermanently, "/pie_chart/")
|
||||
})
|
||||
|
||||
uStore, err := db.NewUserStore(dbName)
|
||||
if err != nil {
|
||||
app.Logger.Fatalf("failed to create store: %s", err)
|
||||
@@ -54,6 +58,15 @@ func main() {
|
||||
lphs := handlers.NewLandingPageHandler(lps)
|
||||
handlers.SetupRoutesLandingPage(app, lphs)
|
||||
|
||||
LpchartStore, err := db.NewPieChartStore(dbName)
|
||||
if err != nil {
|
||||
app.Logger.Fatalf("failed to create store: %s", err)
|
||||
}
|
||||
|
||||
lpchart := services.NewServicesPiechart(services.Piechart{}, LpchartStore)
|
||||
lphsx := handlers.NewPiechartHandler(lpchart)
|
||||
handlers.SetupRoutesPieChart(app, lphsx)
|
||||
|
||||
app.Logger.Fatal(app.Start(":5000"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user