mirror of
https://github.com/KevinMidboe/zoff.git
synced 2026-01-01 15:16:17 +00:00
Search fixes #125, faster lazy-load image, detects localhost
This commit is contained in:
@@ -1,18 +1,6 @@
|
||||
var server;
|
||||
/******
|
||||
|
||||
This if for the localhost running
|
||||
|
||||
******/
|
||||
localhost = false;
|
||||
|
||||
//https server
|
||||
if(localhost)
|
||||
{
|
||||
var http = require('http');
|
||||
server = http.createServer(app);
|
||||
}else
|
||||
{
|
||||
try{
|
||||
var fs = require('fs');
|
||||
var privateKey = fs.readFileSync('/etc/apache2/ssl/private.key', 'utf8');
|
||||
var certificate = fs.readFileSync('/etc/apache2/ssl/ssl.crt', 'utf8');
|
||||
@@ -20,6 +8,13 @@ if(localhost)
|
||||
var https = require('https');
|
||||
server = https.createServer(credentials, app);
|
||||
}
|
||||
catch(err){
|
||||
console.log("Starting without https (probably on localhost)");
|
||||
if(err["errno"] != 34)console.log(err);
|
||||
|
||||
var http = require('http');
|
||||
server = http.createServer(app);
|
||||
}
|
||||
|
||||
var express = require('express');
|
||||
var app = express();
|
||||
|
||||
Reference in New Issue
Block a user