mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
closed #375 - now asking socket.io to connect to "current page" instead of hardcoded url, removed api_url and "socket" section from public config
This commit is contained in:
@@ -17,7 +17,7 @@ var socket,
|
|||||||
socket.socket.connect();
|
socket.socket.connect();
|
||||||
}, 200);
|
}, 200);
|
||||||
} else {
|
} else {
|
||||||
socket = io.connect(config.socket.address);
|
socket = io.connect(RELATIVE_PATH);
|
||||||
|
|
||||||
var reconnecting = false,
|
var reconnecting = false,
|
||||||
reconnectEl, reconnectTimer;
|
reconnectEl, reconnectTimer;
|
||||||
|
|||||||
@@ -9,25 +9,25 @@ jQuery(document).ready(function () {
|
|||||||
|
|
||||||
QUnit.init();
|
QUnit.init();
|
||||||
asyncTest( "Loading Categories", function() {
|
asyncTest( "Loading Categories", function() {
|
||||||
|
|
||||||
jQuery.get(RELATIVE_PATH + '/api/home', function(data) {
|
jQuery.get(RELATIVE_PATH + '/api/home', function(data) {
|
||||||
ok( data.categories.length > 0, JSON.stringify(data.categories) );
|
ok( data.categories.length > 0, JSON.stringify(data.categories) );
|
||||||
|
|
||||||
start();
|
start();
|
||||||
|
|
||||||
for (var i = 0, ii = data.categories.length; i < ii; i++) {
|
for (var i = 0, ii = data.categories.length; i < ii; i++) {
|
||||||
var category = data.categories[i],
|
var category = data.categories[i],
|
||||||
slug = 'category/' + category.slug;
|
slug = 'category/' + category.slug;
|
||||||
|
|
||||||
asyncTest( "Loading Category '" + category.name + "' located at " + slug, function() {
|
asyncTest( "Loading Category '" + category.name + "' located at " + slug, function() {
|
||||||
jQuery.get(config.api_url + slug, function(data) {
|
jQuery.get(RELATIVE_PATH + '/api/' + slug, function(data) {
|
||||||
ok( data.category_name, JSON.stringify(data) ); //todo: check this against data.categories
|
ok( data.category_name, JSON.stringify(data) ); //todo: check this against data.categories
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.start();
|
QUnit.start();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -81,10 +81,6 @@ var async = require('async'),
|
|||||||
protocol = urlObject.protocol,
|
protocol = urlObject.protocol,
|
||||||
server_conf = config,
|
server_conf = config,
|
||||||
client_conf = {
|
client_conf = {
|
||||||
socket: {
|
|
||||||
address: protocol + '//' + host + (config.use_port ? ':' + config.port : '')
|
|
||||||
},
|
|
||||||
api_url: protocol + '//' + host + (config.use_port ? ':' + config.port : '') + relative_path + '/api/',
|
|
||||||
relative_path: relative_path
|
relative_path: relative_path
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user