Browse Source
Fix main app settings variable name collision
feature/update-route-registration
Roman Zipp
3 years ago
committed by
Fabian Vowie
No known key found for this signature in database
GPG Key ID: C27317C33B27C410
1 changed files with
5 additions and
5 deletions
-
main.go
|
|
@ -45,22 +45,22 @@ func RegisterPipelineRoutes(r *mux.Router, pipelines []pipelines.IPipeline, stor |
|
|
|
} |
|
|
|
|
|
|
|
func main() { |
|
|
|
settings, err := settings.LoadSettings(afero.NewOsFs()) |
|
|
|
appSettings, err := settings.LoadSettings(afero.NewOsFs()) |
|
|
|
if err != nil { |
|
|
|
panic(err) |
|
|
|
} |
|
|
|
|
|
|
|
var storageProvider storage.IStorageProvider |
|
|
|
|
|
|
|
if settings.StorageProvider.Type == 0 { |
|
|
|
storageProvider = storage.GetFileSystemStorageProvider(settings.StorageProvider.BasePath, "") |
|
|
|
if appSettings.StorageProvider.Type == 0 { |
|
|
|
storageProvider = storage.GetFileSystemStorageProvider(appSettings.StorageProvider.BasePath, "") |
|
|
|
} else { |
|
|
|
panic("Invalid file system provided!") |
|
|
|
} |
|
|
|
|
|
|
|
pipes := pipelines.LoadPipelines() |
|
|
|
|
|
|
|
authMiddleware := auth.CreateAuthenticationMiddleware(settings.Token) |
|
|
|
authMiddleware := auth.CreateAuthenticationMiddleware(appSettings.Token) |
|
|
|
|
|
|
|
r := mux.NewRouter() |
|
|
|
r.Use(authMiddleware.Middleware) |
|
|
@ -68,7 +68,7 @@ func main() { |
|
|
|
|
|
|
|
RegisterPipelineRoutes(r, pipes, storageProvider) |
|
|
|
|
|
|
|
err = http.ListenAndServe(settings.Endpoint, r) |
|
|
|
err = http.ListenAndServe(appSettings.Endpoint, r) |
|
|
|
if err != nil { |
|
|
|
panic(err) |
|
|
|
} |
|
|
|