mirror of
https://gitlab.com/ric_harvey/MailHog.git
synced 2024-11-27 16:24:04 +00:00
Merge pull request #102 from GREsau/websockets
Use single API constructor
This commit is contained in:
commit
d1fab8fc34
1 changed files with 2 additions and 4 deletions
6
main.go
6
main.go
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue