客户端脚本支持自定义端口

This commit is contained in:
chaos-zhu 2024-10-13 23:07:54 +08:00
parent 09e2c39132
commit d54b682f7a
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ const httpServer = () => {
const app = new Koa() const app = new Koa()
const server = http.createServer(app.callback()) const server = http.createServer(app.callback())
serverHandler(app, server) serverHandler(app, server)
const port = process.env.CLIENT_PORT || defaultPort const port = process.env.clientPort || defaultPort
server.listen(port, () => { server.listen(port, () => {
console.log(`Server(http) is running on port:${ port }`) console.log(`Server(http) is running on port:${ port }`)
}) })

View File

@ -1,10 +1,10 @@
[Unit] [Unit]
Description=easynode client server port_${clientPort} Description=easynode client server
[Service] [Service]
Environment="clientPort=22022"
ExecStart=/root/local/easynode-client/easynode-client ExecStart=/root/local/easynode-client/easynode-client
WorkingDirectory=/root/local/easynode-client WorkingDirectory=/root/local/easynode-client
Environment="clientPort=${clientPort}"
Restart=always Restart=always
RestartSec=5 RestartSec=5