moving websockets to subrouter

This commit is contained in:
Brad Rydzewski 2014-10-16 11:35:25 -07:00
parent b1300be9f0
commit cc71957c8d

View file

@ -11,8 +11,6 @@ func New() *web.Mux {
mux := web.New()
mux.Get("/api/logins", handler.GetLoginList)
mux.Get("/api/stream/stdout/:id", handler.WsConsole)
mux.Get("/api/stream/user", handler.WsUser)
mux.Get("/api/auth/:host", handler.GetLogin)
mux.Post("/api/auth/:host", handler.GetLogin)
mux.Get("/api/badge/:host/:owner/:name/status.svg", handler.GetBadge)
@ -21,6 +19,11 @@ func New() *web.Mux {
mux.Put("/api/hook/:host", handler.PostHook)
mux.Post("/api/hook/:host", handler.PostHook)
streams := web.New()
streams.Get("/api/stream/stdout/:id", handler.WsConsole)
streams.Get("/api/stream/user", handler.WsUser)
mux.Handle("/api/stream/*", streams)
repos := web.New()
repos.Use(middleware.SetRepo)
repos.Use(middleware.RequireRepoRead)