Add admin page

This commit is contained in:
2020-10-11 22:45:08 +02:00
parent a82f090370
commit e5c0df6f6f
7 changed files with 137 additions and 4 deletions

View File

@@ -15,10 +15,11 @@ func RoutesInit(router *gin.Engine, pool *pgxpool.Pool, config *models.Config) {
router.GET("/persons", handler.ShowPersonsList(pool))
// Basic auth accounts
//authorized := router.Group("/admin", gin.BasicAuth(gin.Accounts{
//}))
authorized := router.Group("/admin", gin.BasicAuth(gin.Accounts{
config.ADMIN_NAME: config.ADMIN_PASSWORD,
}))
// Basic auth routes
authorized.GET("/", handler.AdminMainPage(pool))
}