Add some config through flag/env
This commit is contained in:
parent
c60b4ddf73
commit
d0b59cb411
6 changed files with 120 additions and 6 deletions
10
ui/routes.go
10
ui/routes.go
|
|
@ -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"))
|
||||
|
|
|
|||
Reference in a new issue