Skip to content

Commit

Permalink
Add HTTP authentication for mailhog/MailHog#40
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-kent committed May 27, 2015
1 parent fec2db1 commit e1f6a88
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,29 @@ import (
"github.com/mailhog/MailHog-Server/config"
"github.com/mailhog/MailHog-Server/smtp"
"github.com/mailhog/MailHog-UI/assets"
comcfg "github.com/mailhog/MailHog/config"
"github.com/mailhog/http"
)

var conf *config.Config
var comconf *comcfg.Config
var exitCh chan int

func configure() {
comcfg.RegisterFlags()
config.RegisterFlags()
flag.Parse()
conf = config.Configure()
comconf = comcfg.Configure()
}

func main() {
configure()

if comconf.AuthFile != "" {
http.AuthFile(comconf.AuthFile)
}

exitCh = make(chan int)
cb := func(r gohttp.Handler) {
api.CreateAPIv1(conf, r.(*pat.Router))
Expand Down

0 comments on commit e1f6a88

Please sign in to comment.