Use local IP instead of localhost

This commit is contained in:
Chi Vinh Le
2017-12-20 17:41:55 +01:00
parent 998cb8d380
commit 29a60c1241
2 changed files with 7 additions and 7 deletions
+6 -4
View File
@@ -11,6 +11,8 @@ const uniq = require('lodash/uniq');
const ms = require('ms');
const debug = require('debug')('talk:config');
const localAddress = require('ip').address();
//==============================================================================
// CONFIG INITIALIZATION
//==============================================================================
@@ -204,10 +206,10 @@ const CONFIG = {
if (process.env.NODE_ENV === 'test') {
if (!CONFIG.ROOT_URL) {
CONFIG.ROOT_URL = 'http://localhost:3001';
CONFIG.ROOT_URL = `http://${localAddress}:3001`;
}
if (!CONFIG.STATIC_URL) {
CONFIG.STATIC_URI = 'http://localhost:3001';
CONFIG.STATIC_URI = `http://${localAddress}:3001`;
}
} else if (!CONFIG.ROOT_URL) {
throw new Error('TALK_ROOT_URL must be provided');
@@ -261,13 +263,13 @@ CONFIG.JWT_COOKIE_NAMES = uniq(CONFIG.JWT_COOKIE_NAMES.concat([CONFIG.JWT_COOKIE
// testing environment. Every new mongo instance comes with a test database by
// default, this is consistent with common testing and use case practices.
if (process.env.NODE_ENV === 'test' && !CONFIG.MONGO_URL) {
CONFIG.MONGO_URL = 'mongodb://localhost/test';
CONFIG.MONGO_URL = `mongodb://${localAddress}/test`;
}
// Reset the redis url in the event it hasn't been overridden and we are in a
// testing environment.
if (process.env.NODE_ENV === 'test' && !CONFIG.REDIS_URL) {
CONFIG.REDIS_URL = 'redis://localhost/1';
CONFIG.REDIS_URL = `redis://${localAddress}/1`;
}
// REDIS_CLUSTER_CONFIGURATION should be parsed when the cluster mode !== none.
+1 -3
View File
@@ -54,10 +54,8 @@ const nightwatch_config = {
},
safari: {
desiredCapabilities: {
// Safari since 8 seems to have troubles with the browserstack-local tunnel (10.18.17)
browser: 'safari',
browser_version: '10',
browser_version: '11',
},
},
ie: {