I tried deploying my node.js app to Heroku which worked ok until i try to connect to it (open the app). The error is get is as follows:
2021-02-18T00:16:03.975921+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=gtdb.herokuapp.com request_id=16579da6-aa8e-4184-8e1c-7ac9680d0078 fwd="-myipaddresswhichidontwanttoshare-" dyno=web.1 connect=0ms service=1ms status=503 bytes=0 protocol=https
My code:
const express = require("express");
const https = require("https");
app = express();
const options = {
key: fs.readFileSync("./server.key"),
cert: fs.readFileSync("./server.crt")
};
const server = https.createServer(options, app);
server.listen(process.env.PORT);
Of course i searched for the issue and some sites say that it could be a timeout and their errors had connect and service times of up to 30000ms where a timeout would make perfect sense but im far away from 30s so i dont know what the issue is here. The app does not crash after it throws that error. Any help is much appreciated. Thanks in advance.