Get rid of sub-domain code and some other formatting changes

This commit is contained in:
Harshavardhana
2015-05-07 00:14:58 -07:00
parent 8c5a83ddcf
commit 1df28f3060
5 changed files with 42 additions and 91 deletions

View File

@@ -24,12 +24,10 @@ import (
// Config - http server config
type Config struct {
Address string
TLS bool
CertFile string
KeyFile string
Websocket bool // TODO
// Domain string
Address string
TLS bool
CertFile string
KeyFile string
}
// Server - http server related
@@ -59,11 +57,12 @@ func start(ctrlChannel <-chan string, errorChannel chan<- error,
}
log.Println("Starting HTTP Server on:", config.Address)
if config.TLS {
switch {
default:
err = httpServer.ListenAndServe()
case config.TLS == true:
httpServer.TLSConfig = getDefaultTLSConfig()
err = httpServer.ListenAndServeTLS(config.CertFile, config.KeyFile)
} else {
err = httpServer.ListenAndServe()
}
errorChannel <- err
close(errorChannel)