custom-express.js
https = require('https');
var express = require('express');
var fs = require('fs');
module.exports = function(){
var app = express();
var options = {
key: fs.readFileSync('certs/chave.key'),
cert: fs.readFileSync('certs/cert.pem')
};
var appSecure = https.createServer(options, app);
return appSecure;
}
index.js
var customExpress = require('./config/custom-express');
var https = customExpress();
https.listen(3000, function(){
console.log("Servidor executando na porta 3000");
})
Amigos gostaria de ideias para acessar os métodos http do express -> GET, POST e etc no controller?
Atenciosamente,