Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function createServer(useHTTPS) {
if (useHTTPS) {
log('using HTTPS');
var FS = require('fs');
return Express.createServer({
ca: FS.readFileSync(__dirname + '/../certs/'),
key: FS.readFileSync(__dirname + '/../certs/ssl.key'),
cert: FS.readFileSync(__dirname + '/../certs/ssl.crt')
} else {
return Express.createServer();
function initApp(useHTTPS) {
// express
var App = createServer(useHTTPS);
App.configure(function() {
if (!Env.test) {
log('Going to listen on port', useHTTPS ? Env.HTTPSPORT : Env.HTTPPORT);
App.listen(useHTTPS ? Env.HTTPSPORT : Env.HTTPPORT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.