Commit ef494cfa authored by yPhil's avatar yPhil
Browse files

Port number config

- HTTP **and** HTTPS environment variables
- Both servers must remain available for now
parent 06776be0
Pipeline #404605 passed with stage
in 1 minute and 10 seconds
......@@ -38,9 +38,9 @@ News feeds are organized into tabs, which can contain an infinite number of colu
git clone https://framagit.org/yphil/petrolette
cd petrolette
npm install
PORT=8000
PTL_PORT_HTTP=8080
npm start
xdg-open http://localhost:$PORT
xdg-open http://localhost:$PTL_PORT_HTTP
```
#### Testing
......
......@@ -6,9 +6,10 @@ const petrolette = require('../petrolette'),
const httpServer = http.createServer(petrolette);
/* look for port in environment variable */
const port = parseInt(process.env["PORT"]) || 8000;
const portHttp = parseInt(process.env["PTL_PORT_HTTP"]) || 8000;
const portHttps = parseInt(process.env["PTL_PORT_HTTPS"]) || 8001;
httpServer.listen(port, () => {
httpServer.listen(portHttp, () => {
console.debug('HTTP Server running on port %s', port);
});
......@@ -18,6 +19,6 @@ const httpsServer = https.createServer({
ca: fs.readFileSync('/etc/letsencrypt/live/petrolette.space/chain.pem'),
}, petrolette);
httpsServer.listen(8001, () => {
httpsServer.listen(portHttps, () => {
console.debug('HTTPS Server running');
});
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