Hi there. Deploying an existing express app from Heroku, and getting an error about port in use. This is an API that should be responding on port 80/443 depending on HTTPS status.
My code:
const server = http.createServer(app);
server.listen(process.env.PORT, () => {
logger.info(`Server is listening on port ${process.env.PORT}`);
});
I am not setting an environment variable for PORT, as I believe Render does this automatically right? I am sure this is something trivial - first Render web service, looking to move a bunch of stuff over from Heroku.
Here is the error I am getting:
{
code: 'EACCES',
errno: -13,
syscall: 'listen',
address: '0.0.0.0',
port: 443,
level: 'error',
app: 'api',
message: 'listen EACCES: permission denied 0.0.0.0:443',
stack: 'Error: listen EACCES: permission denied 0.0.0.0:443\n' +
' at Server.setupListenHandle [as _listen2] (node:net:1302:21)\n' +
' at listenInCluster (node:net:1367:12)\n' +
' at Server.listen (node:net:1454:7)\n' +
' at /opt/render/project/src/lib/src/server.js:33:12\n' +
' at Object.<anonymous> (/opt/render/project/src/lib/src/server.js:36:3)\n' +
' at Module._compile (node:internal/modules/cjs/loader:1101:14)\n' +
' at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\n' +
' at Module.load (node:internal/modules/cjs/loader:981:32)\n' +
' at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n' +
' at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)\n' +
' at node:internal/main/run_main_module:17:47'
}