specify http server binding

This commit is contained in:
Martin Boehm
2018-01-19 00:18:08 +01:00
parent a9bfb59103
commit 8676db1e14
2 changed files with 6 additions and 6 deletions

View File

@@ -19,9 +19,9 @@ type HttpServer struct {
db *db.RocksDB
}
func New(db *db.RocksDB) (*HttpServer, error) {
func New(httpServerBinding string, db *db.RocksDB) (*HttpServer, error) {
https := &http.Server{
Addr: ":8333",
Addr: httpServerBinding,
}
s := &HttpServer{
https: https,
@@ -43,7 +43,7 @@ func New(db *db.RocksDB) (*HttpServer, error) {
// Run starts the server
func (s *HttpServer) Run() error {
log.Printf("http server starting on port %s", s.https.Addr)
log.Printf("http server starting to listen on %s", s.https.Addr)
return s.https.ListenAndServe()
}