swarm/api/http: http package refactoring 1/5 and 2/5 (#17164)
This commit is contained in:
committed by
Balint Gabor
parent
facf1bc9d6
commit
f7d3678c28
@ -388,10 +388,9 @@ func (self *Swarm) Start(srv *p2p.Server) error {
|
||||
// start swarm http proxy server
|
||||
if self.config.Port != "" {
|
||||
addr := net.JoinHostPort(self.config.ListenAddr, self.config.Port)
|
||||
go httpapi.StartHTTPServer(self.api, &httpapi.ServerConfig{
|
||||
Addr: addr,
|
||||
CorsString: self.config.Cors,
|
||||
})
|
||||
server := httpapi.NewServer(self.api, self.config.Cors)
|
||||
|
||||
go server.ListenAndServe(addr)
|
||||
}
|
||||
|
||||
log.Debug(fmt.Sprintf("Swarm http proxy started on port: %v", self.config.Port))
|
||||
|
Reference in New Issue
Block a user