[Backend] Make certificate available for production server
Summary
At the moment we cant run the server in production mode (https) as we do not have the certificates available.
Possible fixes
Once the cert
and key
files are available we have to load them on server launch:
In the app/server.ts
we have to add.
Additionally also have to think about a way to start the http server in dev mode (i.e. if config.NODE_ENV !== "production"
) !
import { createServer } from "https";
/*
...
*/
const httpsOptions = {
key: fs.readFileSync("./certificate.key"),
cert: fs.readFileSync("./certificate.crt"),
};
/*
...
*/
const https_server = createServer(httpsOptions, async (req, res) => {
/*
...
*/
}
Edited by Sebastian Bernd Mohr