Skip to content

Commit

Permalink
Merge pull request #102 from GREsau/websockets
Browse files Browse the repository at this point in the history
Use single API constructor
  • Loading branch information
ian-kent committed Jul 7, 2016
2 parents 52a0a37 + 8dfadf4 commit d1fab8f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,12 @@ func main() {
if uiconf.UIBindAddr == apiconf.APIBindAddr {
cb := func(r gohttp.Handler) {
web.CreateWeb(uiconf, r.(*pat.Router), assets.Asset)
api.CreateAPIv1(apiconf, r.(*pat.Router))
api.CreateAPIv2(apiconf, r.(*pat.Router))
api.CreateAPI(apiconf, r.(*pat.Router))
}
go http.Listen(uiconf.UIBindAddr, assets.Asset, exitCh, cb)
} else {
cb1 := func(r gohttp.Handler) {
api.CreateAPIv1(apiconf, r.(*pat.Router))
api.CreateAPIv2(apiconf, r.(*pat.Router))
api.CreateAPI(apiconf, r.(*pat.Router))
}
cb2 := func(r gohttp.Handler) {
web.CreateWeb(uiconf, r.(*pat.Router), assets.Asset)
Expand Down

0 comments on commit d1fab8f

Please sign in to comment.