У меня есть проект locomotive.js MVC и его прослушивание на http. Я хочу слушать https и перенаправить все http на https.locomotive.js слушать http и https
я не могу найти createServer из Node.js, единственный код, я нашел это: под /lib/node_modules/locomotive/lib/locomotive/cli/server.js
console.log('booting app at %s in %s environment', dir, env);
locomotive.boot(dir, env, function(err, server) {
if (err) {
throw err;
}
server.listen(port, address, function() {
var addr = this.address();
console.log('listening on %s:%d', addr.address, addr.port, addr);
});
});
изменен:
console.log('booting app at %s in %s environment', dir, env);
var crypto = require('crypto'),
fs = require("fs");
var privateKey = fs.readFileSync('/privatekey.pem').toString();
var certificate = fs.readFileSync('/certificate.pem').toString();
var https = require('https');
var credentials = crypto.createCredentials({key: privateKey, cert: certificate});
и я сейчас застрял, любая помощь?
Спасибо!