|
@ -36,7 +36,9 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func RegisterPipelineRoutes(r *mux.Router, pipelines []pipelines.IPipeline, storageProvider storage.IStorageProvider) { |
|
|
|
|
|
|
|
|
func RegisterRoutes(r *mux.Router, pipelines []pipelines.IPipeline, storageProvider storage.IStorageProvider) { |
|
|
|
|
|
r.HandleFunc("/", IndexHandler) |
|
|
|
|
|
|
|
|
for _, pipeline := range pipelines { |
|
|
for _, pipeline := range pipelines { |
|
|
r.HandleFunc("/"+pipeline.GetSlug(), func(w http.ResponseWriter, r *http.Request) { |
|
|
r.HandleFunc("/"+pipeline.GetSlug(), func(w http.ResponseWriter, r *http.Request) { |
|
|
PipelineHandler(pipeline, storageProvider, w, r) |
|
|
PipelineHandler(pipeline, storageProvider, w, r) |
|
@ -64,9 +66,8 @@ func main() { |
|
|
|
|
|
|
|
|
r := mux.NewRouter() |
|
|
r := mux.NewRouter() |
|
|
r.Use(authMiddleware.Middleware) |
|
|
r.Use(authMiddleware.Middleware) |
|
|
r.HandleFunc("/", IndexHandler) |
|
|
|
|
|
|
|
|
|
|
|
RegisterPipelineRoutes(r, pipes, storageProvider) |
|
|
|
|
|
|
|
|
RegisterRoutes(r, pipes, storageProvider) |
|
|
|
|
|
|
|
|
err = http.ListenAndServe(appSettings.Endpoint, r) |
|
|
err = http.ListenAndServe(appSettings.Endpoint, r) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|