Skip to content

Instantly share code, notes, and snippets.

@paulohp
Last active August 29, 2015 14:10
Show Gist options
  • Save paulohp/0fd16f0ea8befa4116dc to your computer and use it in GitHub Desktop.
Save paulohp/0fd16f0ea8befa4116dc to your computer and use it in GitHub Desktop.
var fs = require('fs');
var https = require('https');
var http = require('http');
var express = require('express');
var path = require('path');
var app = express();
var config = {
key: fs.readFileSync(path.join(__dirname, 'config/certificates/server.key')),
cert: fs.readFileSync(path.join(__dirname, 'config/certificates/server.crt'))
};
var port = process.env.PORT || 8080;
http.createServer(app).listen(port, function(){
console.log("Buky rodando na porta: " + port);
});
https.createServer(config, app).listen(443);
module.exports = app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment