more fixes for relative paths

This commit is contained in:
Baris Soner Usakli
2013-07-11 15:50:19 -04:00
parent d3c5afd94c
commit de55a35684
4 changed files with 123 additions and 95 deletions

12
app.js
View File

@@ -152,10 +152,14 @@ fs.readFile(path.join(__dirname, 'config.json'), function(err, data) {
if (!secret) secret = utils.generateUUID();
if (!bcrypt_rounds) bcrypt_rounds = 10;
var urlObject = url.parse(base_url);
var relative_path = urlObject.pathname;
var host = urlObject.host;
var protocol = urlObject.protocol;
var urlObject = url.parse(base_url),
relative_path = urlObject.pathname,
host = urlObject.host,
protocol = urlObject.protocol;
if(relative_path.length === 1) {
relative_path = '';
}
var fs = require('fs'),
path = require('path'),