You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone, I need some help because I'm very new doing all of this.
Currently, I have myapp running perfectly on http://localhost/myapp
Now, I would like to have it running on https://localhost/myapp
I have correctly installed the certificates and the https://localhost is on and it displays a message: "Hello, HTTPS World!"
Now, how can I run myapp on https://localhost/myapp ??
myapp is a directory located in C:\Apache24\htdocs\myapp
The code of my server.js file is: const app = require('express')(); const https = require('https'); const fs = require('fs');
const options = { key: fs.readFileSync('build/cert/server.key'), cert: fs.readFileSync('build/cert/server.crt'), } https.createServer(options, (req, res) => { res.writeHead(200); res.end('Hello, HTTPS World!'); }).listen(443, () => { console.log('Server is running on port 443'); });
OS: Win 10
Any help or hint will be much appreciated.
The text was updated successfully, but these errors were encountered:
FYI, for future reference, we do not to technical support here. Please use stackoverflow or reddit to ask general questions like this. This is for bugs, features, and otherwise improving the express project itself. Thanks.
Hi everyone, I need some help because I'm very new doing all of this.
Currently, I have myapp running perfectly on http://localhost/myapp
Now, I would like to have it running on https://localhost/myapp
I have correctly installed the certificates and the https://localhost is on and it displays a message: "Hello, HTTPS World!"
Now, how can I run myapp on https://localhost/myapp ??
myapp is a directory located in C:\Apache24\htdocs\myapp
The code of my server.js file is:
const app = require('express')();
const https = require('https');
const fs = require('fs');
const options = {
key: fs.readFileSync('build/cert/server.key'),
cert: fs.readFileSync('build/cert/server.crt'),
}
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end('Hello, HTTPS World!');
}).listen(443, () => {
console.log('Server is running on port 443');
});
OS: Win 10
Any help or hint will be much appreciated.
The text was updated successfully, but these errors were encountered: