OSDN Git Service

add default port
authorHAOYUatHZ <haoyu@protonmail.com>
Thu, 27 Jun 2019 07:20:24 +0000 (15:20 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Thu, 27 Jun 2019 07:20:24 +0000 (15:20 +0800)
federation/api/server.go

index 330b1de..fb45eba 100644 (file)
@@ -43,6 +43,9 @@ func (server *Server) setupRouter() {
 }
 
 func (s *Server) Run() {
+       if s.cfg.API.ListeningPort == 0 {
+               s.cfg.API.ListeningPort = 3000
+       }
        s.engine.Run(fmt.Sprintf(":%d", s.cfg.API.ListeningPort))
 }