Remove gotcha (fix #42)

This commit is contained in:
Ian Kent 2015-04-19 18:06:05 +01:00
parent f4a8a8c8eb
commit 320a41fcd9
2 changed files with 32 additions and 11 deletions

View file

@ -1,3 +1,5 @@
VERSION=0.1.7
all: deps fmt combined
combined:
@ -14,7 +16,6 @@ deps:
go get github.com/mailhog/MailHog-UI
cd ../MailHog-UI; make bindata
go get github.com/mailhog/http
go get github.com/ian-kent/gotcha/gotcha
go get github.com/ian-kent/go-log/log
go get github.com/ian-kent/envconf
go get github.com/ian-kent/goose
@ -31,4 +32,22 @@ test-deps:
release-deps:
go get github.com/mitchellh/gox
pull:
git pull
cd ../data; git pull
cd ../http; git pull
cd ../MailHog-Server; git pull
cd ../MailHog-UI; git pull
cd ../smtp; git pull
cd ../storage; git pull
tag:
git tag -a -m 'v${VERSION}' ${VERSION} && git push origin ${VERSION}
cd ../data; git tag -a -m 'v${VERSION}' ${VERSION} && git push origin ${VERSION}
cd ../http; git tag -a -m 'v${VERSION}' ${VERSION} && git push origin ${VERSION}
cd ../MailHog-Server; git tag -a -m 'v${VERSION}' ${VERSION} && git push origin ${VERSION}
cd ../MailHog-UI; git tag -a -m 'v${VERSION}' ${VERSION} && git push origin ${VERSION}
cd ../smtp; git tag -a -m 'v${VERSION}' ${VERSION} && git push origin ${VERSION}
cd ../storage; git tag -a -m 'v${VERSION}' ${VERSION} && git push origin ${VERSION}
.PNONY: all combined release fmt deps test-deps release-deps

22
main.go
View file

@ -4,8 +4,10 @@ import (
"flag"
"os"
gohttp "net/http"
"github.com/gorilla/pat"
"github.com/ian-kent/go-log/log"
gotcha "github.com/ian-kent/gotcha/app"
"github.com/mailhog/MailHog-Server/api"
cfgapi "github.com/mailhog/MailHog-Server/config"
"github.com/mailhog/MailHog-Server/smtp"
@ -32,19 +34,19 @@ func main() {
exitCh = make(chan int)
if uiconf.UIBindAddr == apiconf.APIBindAddr {
cb := func(app *gotcha.App) {
web.CreateWeb(uiconf, app)
api.CreateAPIv1(apiconf, app)
api.CreateAPIv2(apiconf, app)
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))
}
go http.Listen(uiconf.UIBindAddr, assets.Asset, exitCh, cb)
} else {
cb1 := func(app *gotcha.App) {
api.CreateAPIv1(apiconf, app)
api.CreateAPIv2(apiconf, app)
cb1 := func(r gohttp.Handler) {
api.CreateAPIv1(apiconf, r.(*pat.Router))
api.CreateAPIv2(apiconf, r.(*pat.Router))
}
cb2 := func(app *gotcha.App) {
web.CreateWeb(uiconf, app)
cb2 := func(r gohttp.Handler) {
web.CreateWeb(uiconf, r.(*pat.Router), assets.Asset)
}
go http.Listen(apiconf.APIBindAddr, assets.Asset, exitCh, cb1)
go http.Listen(uiconf.UIBindAddr, assets.Asset, exitCh, cb2)