try require from root

v1.18.x
barisusakli 8 years ago
parent 9e094184ba
commit 817cd29f00

@ -230,18 +230,17 @@ function listen(callback) {
winston.info('Using ports 80 and 443 is not recommend; use a proxy instead. See README.md');
}
var args = isSocket ? [socketPath] : [port, nconf.get('bind_address')];
var bind_address = ((nconf.get('bind_address') === "0.0.0.0" || !nconf.get('bind_address')) ? '0.0.0.0' : nconf.get('bind_address')) + ':' + port;
var bind_address = ((nconf.get('bind_address') === "0.0.0.0" || !nconf.get('bind_address')) ? '0.0.0.0' : nconf.get('bind_address'));
var args = isSocket ? [socketPath] : [port, bind_address];
var oldUmask;
args.push(function (err) {
if (err) {
winston.info('[startup] NodeBB was unable to listen on: ' + bind_address);
winston.info('[startup] NodeBB was unable to listen on: ' + bind_address + ':' + port);
process.exit();
}
winston.info('NodeBB is now listening on: ' + (isSocket ? socketPath : bind_address));
winston.info('NodeBB is now listening on: ' + (isSocket ? socketPath : bind_address + ':' + port));
if (oldUmask) {
process.umask(oldUmask);
}

@ -11,6 +11,17 @@ var db = require('./mocks/databasemock');
describe('authentication', function () {
var jar = request.jar();
before(function(done) {
request({
url: nconf.get('url') + '/api/config',
json: true,
jar: jar
}, function (err, response, body) {
console.log('lel', body);
done();
});
});
it('should register and login a user', function (done) {
request({
url: nconf.get('url') + '/api/config',

@ -4,7 +4,12 @@
var xhrPath = '../../node_modules/socket.io-client/node_modules/engine.io-client/node_modules/xmlhttprequest-ssl';
// Make initial call to require so module is cached.
require(xhrPath);
try {
require(xhrPath);
} catch(e) {
require('xmlhttprequest-ssl');
}
var name = require.resolve(xhrPath);
// Get cached version.

Loading…
Cancel
Save