Try to fix subdomains (2/2)
Signed-off-by: Arzumify <jliwin98@danwin1210.de>
This commit is contained in:
parent
c4dae7ac03
commit
eb4b07840e
5
main.go
5
main.go
|
@ -565,16 +565,17 @@ func main() {
|
|||
lock.Unlock()
|
||||
|
||||
// Check if they want a subdomain
|
||||
finalRouter := chi.NewRouter()
|
||||
var finalRouter *chi.Mux
|
||||
serviceConfig, ok := config.Services[strings.ToLower(serviceInformation.Name)]
|
||||
if !ok {
|
||||
slog.Error("Service configuration not found for service: ", serviceInformation.Name)
|
||||
os.Exit(1)
|
||||
}
|
||||
if serviceConfig.(map[string]interface{})["subdomain"] != nil {
|
||||
finalRouter = chi.NewRouter()
|
||||
hostRouter.Map(serviceConfig.(map[string]interface{})["subdomain"].(string), finalRouter)
|
||||
} else {
|
||||
hostRouter.Map("", finalRouter)
|
||||
finalRouter = router
|
||||
}
|
||||
|
||||
slog.Info("Activating service " + serviceInformation.Name + " with ID " + serviceInformation.ServiceID.String())
|
||||
|
|
Loading…
Reference in New Issue