This commit is contained in:
@@ -107,6 +107,9 @@ func main() {
|
||||
return c.JSON(fiber.Map{"ok": true})
|
||||
})
|
||||
|
||||
api.Get("/public/app-downloads", handlers.ListAppDownloadsPublicHandler(gormDB))
|
||||
api.Get("/public/guide-links", handlers.ListGuideLinksPublicHandler(gormDB))
|
||||
|
||||
// Management — yêu cầu đăng nhập staff
|
||||
staff := api.Group("", middleware.RequireStaff())
|
||||
staff.Get("/auth/me", handlers.MeStaffHandler(gormDB))
|
||||
@@ -207,6 +210,11 @@ func main() {
|
||||
staff.Put("/guide-links/:id", handlers.UpdateGuideLinkHandler(gormDB))
|
||||
staff.Delete("/guide-links/:id", handlers.DeleteGuideLinkHandler(gormDB))
|
||||
|
||||
staff.Get("/app-downloads", handlers.ListAppDownloadsHandler(gormDB))
|
||||
staff.Post("/app-downloads", handlers.CreateAppDownloadHandler(gormDB))
|
||||
staff.Put("/app-downloads/:id", handlers.UpdateAppDownloadHandler(gormDB))
|
||||
staff.Delete("/app-downloads/:id", handlers.DeleteAppDownloadHandler(gormDB))
|
||||
|
||||
go func() {
|
||||
ticker := time.NewTicker(30 * time.Second)
|
||||
defer ticker.Stop()
|
||||
@@ -215,6 +223,8 @@ func main() {
|
||||
}
|
||||
}()
|
||||
|
||||
app.Static("/", "../landing_page")
|
||||
|
||||
port := getEnv("PORT", "8080")
|
||||
log.Printf("Server starting on port %s...", port)
|
||||
if err := app.Listen(":" + port); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user