mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-01-24 05:38:15 -05:00
20 lines
334 B
Go
20 lines
334 B
Go
|
package api
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"net/http"
|
||
|
|
||
|
"npm/internal/logger"
|
||
|
)
|
||
|
|
||
|
const httpPort = 3000
|
||
|
|
||
|
// StartServer creates a http server
|
||
|
func StartServer() {
|
||
|
logger.Info("Server starting on port %v", httpPort)
|
||
|
err := http.ListenAndServe(fmt.Sprintf(":%v", httpPort), NewRouter())
|
||
|
if err != nil {
|
||
|
logger.Error("HttpListenError", err)
|
||
|
}
|
||
|
}
|