feat: allow disabling login page

Resolves #89
This commit is contained in:
Lakhan Samani
2021-12-29 05:41:39 +05:30
parent 8d2371c14e
commit df192bed4d
3 changed files with 12 additions and 7 deletions

View File

@@ -32,14 +32,17 @@ func main() {
router := router.InitRouter()
// login wall app related routes.
// login page app related routes.
// if we put them in router file then tests would fail as templates or build path will be different
router.LoadHTMLGlob("templates/*")
app := router.Group("/app")
{
app.Static("/build", "app/build")
app.GET("/", handlers.AppHandler())
app.GET("/reset-password", handlers.AppHandler())
if !constants.DISABLE_LOGIN_PAGE {
router.LoadHTMLGlob("templates/*")
app := router.Group("/app")
{
app.Static("/build", "app/build")
app.GET("/", handlers.AppHandler())
app.GET("/reset-password", handlers.AppHandler())
}
}
router.Run(":" + constants.PORT)
}