Last active
August 29, 2015 14:10
-
-
Save paulohp/0fd16f0ea8befa4116dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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