Skip to content

Node.js based forum software built for the modern web

closed #375 - now asking socket.io to connect to "current page" instead of hardcoded url, removed api_url and "socket" section from public config

Julian Lam948949c5710a
diff --git a/public/src/app.js b/public/src/app.js
index 5b9918afed..94108cd895 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -17,7 +17,7 @@ var socket,
socket.socket.connect();
}, 200);
} else {
- socket = io.connect(config.socket.address);
+ socket = io.connect(RELATIVE_PATH);
var reconnecting = false,
reconnectEl, reconnectTimer;
diff --git a/public/templates/admin/testing/categories.tpl b/public/templates/admin/testing/categories.tpl
index 1b2709d1fb..37a784d550 100644
--- a/public/templates/admin/testing/categories.tpl
+++ b/public/templates/admin/testing/categories.tpl
@@ -9,25 +9,25 @@ jQuery(document).ready(function () {
QUnit.init();
asyncTest( "Loading Categories", function() {
-
+
jQuery.get(RELATIVE_PATH + '/api/home', function(data) {
ok( data.categories.length > 0, JSON.stringify(data.categories) );
-
+
start();
-
+
for (var i = 0, ii = data.categories.length; i < ii; i++) {
var category = data.categories[i],
slug = 'category/' + category.slug;
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
start();
});
});
}
});
- });
+ });
QUnit.start();
});
diff --git a/src/install.js b/src/install.js
index 84eb798f2c..d84682ebc7 100644
--- a/src/install.js
+++ b/src/install.js
@@ -81,10 +81,6 @@ var async = require('async'),
protocol = urlObject.protocol,
server_conf = config,
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
};