Add some config through flag/env

This commit is contained in:
nemunaire 2021-05-02 22:49:51 +02:00
commit d0b59cb411
6 changed files with 120 additions and 6 deletions

View file

@ -1,10 +1,18 @@
package ui
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/nemunaire/minifaas/config"
)
func DeclareRoutes(router *gin.Engine) {
func DeclareRoutes(router *gin.Engine, cfg *config.Config) {
if cfg.Dev {
Assets = http.Dir("./ui")
}
router.GET("/", serveOrReverse("/"))
router.GET("/favicon.ico", serveOrReverse("/favicon.ico"))
router.GET("/manifest.json", serveOrReverse("/manifest.json"))