Merge pull request #581 from bradrydzewski/master

moving websockets to subrouter
This commit is contained in:
Brad Rydzewski 2014-10-16 12:43:51 -07:00
commit 6a6cef157f
3 changed files with 8 additions and 4 deletions

View file

@ -1039,6 +1039,7 @@ nav {
color:#666;
line-height:22px;
font-size:14px;
word-break: break-all;
}
}

View file

@ -87,7 +87,7 @@
<h2>Status Badge</h2>
</div>
<div class="pure-u-1">
<div class="markdown">{{ repo | badgeMarkdown }}</div>
<pre class="markdown">{{ repo | badgeMarkdown }}</pre>
</div>
</div>
</section>

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)