mirror of
https://gitlab.com/ric_harvey/MailHog.git
synced 2025-02-17 08:15:55 +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 {
|
if uiconf.UIBindAddr == apiconf.APIBindAddr {
|
||||||
cb := func(r gohttp.Handler) {
|
cb := func(r gohttp.Handler) {
|
||||||
web.CreateWeb(uiconf, r.(*pat.Router), assets.Asset)
|
web.CreateWeb(uiconf, r.(*pat.Router), assets.Asset)
|
||||||
api.CreateAPIv1(apiconf, r.(*pat.Router))
|
api.CreateAPI(apiconf, r.(*pat.Router))
|
||||||
api.CreateAPIv2(apiconf, r.(*pat.Router))
|
|
||||||
}
|
}
|
||||||
go http.Listen(uiconf.UIBindAddr, assets.Asset, exitCh, cb)
|
go http.Listen(uiconf.UIBindAddr, assets.Asset, exitCh, cb)
|
||||||
} else {
|
} else {
|
||||||
cb1 := func(r gohttp.Handler) {
|
cb1 := func(r gohttp.Handler) {
|
||||||
api.CreateAPIv1(apiconf, r.(*pat.Router))
|
api.CreateAPI(apiconf, r.(*pat.Router))
|
||||||
api.CreateAPIv2(apiconf, r.(*pat.Router))
|
|
||||||
}
|
}
|
||||||
cb2 := func(r gohttp.Handler) {
|
cb2 := func(r gohttp.Handler) {
|
||||||
web.CreateWeb(uiconf, r.(*pat.Router), assets.Asset)
|
web.CreateWeb(uiconf, r.(*pat.Router), assets.Asset)
|
||||||
|
|
Loading…
Add table
Reference in a new issue