Unverified Commit af5c069d authored by Balázs Orbán's avatar Balázs Orbán Committed by GitHub

feat(standalone): allow configuring `HOSTNAME` via env var (#44627)

Resolves #44626
parent d1db92c7
...@@ -1762,6 +1762,7 @@ const server = http.createServer(async (req, res) => { ...@@ -1762,6 +1762,7 @@ const server = http.createServer(async (req, res) => {
} }
}) })
const currentPort = parseInt(process.env.PORT, 10) || 3000 const currentPort = parseInt(process.env.PORT, 10) || 3000
const hostname = process.env.HOSTNAME || 'localhost'
server.listen(currentPort, (err) => { server.listen(currentPort, (err) => {
if (err) { if (err) {
...@@ -1769,7 +1770,7 @@ server.listen(currentPort, (err) => { ...@@ -1769,7 +1770,7 @@ server.listen(currentPort, (err) => {
process.exit(1) process.exit(1)
} }
const nextServer = new NextServer({ const nextServer = new NextServer({
hostname: 'localhost', hostname,
port: currentPort, port: currentPort,
dir: path.join(__dirname), dir: path.join(__dirname),
dev: false, dev: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment