|
@ -45,22 +45,22 @@ func RegisterPipelineRoutes(r *mux.Router, pipelines []pipelines.IPipeline, stor |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func main() { |
|
|
func main() { |
|
|
settings, err := settings.LoadSettings(afero.NewOsFs()) |
|
|
|
|
|
|
|
|
appSettings, err := settings.LoadSettings(afero.NewOsFs()) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
panic(err) |
|
|
panic(err) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var storageProvider storage.IStorageProvider |
|
|
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 { |
|
|
} else { |
|
|
panic("Invalid file system provided!") |
|
|
panic("Invalid file system provided!") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pipes := pipelines.LoadPipelines() |
|
|
pipes := pipelines.LoadPipelines() |
|
|
|
|
|
|
|
|
authMiddleware := auth.CreateAuthenticationMiddleware(settings.Token) |
|
|
|
|
|
|
|
|
authMiddleware := auth.CreateAuthenticationMiddleware(appSettings.Token) |
|
|
|
|
|
|
|
|
r := mux.NewRouter() |
|
|
r := mux.NewRouter() |
|
|
r.Use(authMiddleware.Middleware) |
|
|
r.Use(authMiddleware.Middleware) |
|
@ -68,7 +68,7 @@ func main() { |
|
|
|
|
|
|
|
|
RegisterPipelineRoutes(r, pipes, storageProvider) |
|
|
RegisterPipelineRoutes(r, pipes, storageProvider) |
|
|
|
|
|
|
|
|
err = http.ListenAndServe(settings.Endpoint, r) |
|
|
|
|
|
|
|
|
err = http.ListenAndServe(appSettings.Endpoint, r) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
panic(err) |
|
|
panic(err) |
|
|
} |
|
|
} |
|
|