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'); winston.info('Using ports 80 and 443 is not recommend; use a proxy instead. See README.md');
} }
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, nconf.get('bind_address')]; var args = isSocket ? [socketPath] : [port, 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 oldUmask; var oldUmask;
args.push(function (err) { args.push(function (err) {
if (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(); 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) { if (oldUmask) {
process.umask(oldUmask); process.umask(oldUmask);
} }

@ -11,6 +11,17 @@ var db = require('./mocks/databasemock');
describe('authentication', function () { describe('authentication', function () {
var jar = request.jar(); 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) { it('should register and login a user', function (done) {
request({ request({
url: nconf.get('url') + '/api/config', 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'; 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. // Make initial call to require so module is cached.
require(xhrPath); try {
require(xhrPath);
} catch(e) {
require('xmlhttprequest-ssl');
}
var name = require.resolve(xhrPath); var name = require.resolve(xhrPath);
// Get cached version. // Get cached version.

Loading…
Cancel
Save