var config = require('./config.js'); var app = express(); var server = require('https').Server({ key: fs.readFileSync('site.key'), cert: fs.readFileSync('site_public.crt'), ca: [fs.readFileSync('site_intermediate.crt')], passphrase: 'password' }, app); // or var server = require('https').Server(app); app.get('/', function (req, res) { return res.send('online'); }); app.use(function(req, res) { res.status(404).render('error', {error: 'Page introuvable'}); }) server.listen(config.port, function() { console.log('ready to go on '+config.port); });