Add public theme
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 2m52s
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 2m52s
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/core/application"
|
||||
cache "git.coopgo.io/coopgo-apps/parcoursmob/core/utils/storage"
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/services"
|
||||
"git.coopgo.io/coopgo-platform/emailing"
|
||||
)
|
||||
|
||||
// DataProvider returns data to hydrate a page
|
||||
@@ -36,6 +37,7 @@ type PublicWebServer struct {
|
||||
kv cache.KVHandler
|
||||
filestorage cache.FileStorage
|
||||
applicationHandler *application.ApplicationHandler
|
||||
mailer *emailing.Mailer
|
||||
rootDir string
|
||||
dynamicRoutes map[string]DynamicRoute
|
||||
}
|
||||
@@ -46,6 +48,7 @@ func Run(
|
||||
applicationHandler *application.ApplicationHandler,
|
||||
kv cache.KVHandler,
|
||||
filestorage cache.FileStorage,
|
||||
mailer *emailing.Mailer,
|
||||
) {
|
||||
address := cfg.GetString("server.publicweb.listen")
|
||||
rootDir := cfg.GetString("server.publicweb.root_dir")
|
||||
@@ -57,6 +60,7 @@ func Run(
|
||||
kv: kv,
|
||||
filestorage: filestorage,
|
||||
applicationHandler: applicationHandler,
|
||||
mailer: mailer,
|
||||
rootDir: rootDir,
|
||||
dynamicRoutes: make(map[string]DynamicRoute),
|
||||
}
|
||||
@@ -67,6 +71,9 @@ func Run(
|
||||
|
||||
r.HandleFunc("/health", server.healthHandler).Methods("GET")
|
||||
|
||||
// Setup API routes
|
||||
server.setupAPIRoutes(r)
|
||||
|
||||
for pattern := range server.dynamicRoutes {
|
||||
r.HandleFunc(pattern, server.dynamicHandler).Methods("GET", "POST")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user