bringing subfolder installations to v0.4.0 - JUST FOR @PLANNER

v1.18.x
Julian Lam 11 years ago
parent f99c1f9921
commit 5a8a3627d2

@ -28,7 +28,8 @@ var socket,
var reconnection_delay = 200;
socket = io.connect('', {
'max reconnection attempts': max_reconnection_attemps,
'reconnection delay': reconnection_delay
'reconnection delay': reconnection_delay,
resource: RELATIVE_PATH.slice(1) + '/socket.io'
});
var reconnecting = false,

@ -246,7 +246,7 @@ var fs = require('fs'),
'src/overrides.js',
'src/utils.js'
],
minFile: nconf.get('relative_path') + 'nodebb.min.js',
minFile: 'nodebb.min.js',
get: function (callback) {
plugins.fireHook('filter:scripts.get', this.scripts, function(err, scripts) {
var ctime,

@ -6,9 +6,10 @@ var nconf = require('nconf'),
validator = require('validator'),
_ = require('underscore'),
async = require('async'),
plugins = require('../plugins'),
plugins = require('../plugins');
PluginRoutes = function(app) {
(function(Plugins) {
Plugins.createRoutes = function(app) {
app.get('/plugins/fireHook', function(req, res) {
// GET = filter
plugins.fireHook('filter:' + req.query.hook, req.query.args, function(err, returnData) {
@ -70,5 +71,4 @@ var nconf = require('nconf'),
}
});
};
module.exports = PluginRoutes;
})(exports);

@ -28,11 +28,11 @@ var io;
Sockets.init = function(server) {
io = socketioWildcard(SocketIO).listen(server, {
log: false,
transports: ['websocket', 'xhr-polling', 'jsonp-polling', 'flashsocket'],
'browser client minification': true
'browser client minification': true,
resource: nconf.get('relative_path') + '/socket.io'
});
Sockets.server = io;

@ -33,7 +33,8 @@ var path = require('path'),
userRoute = require('./routes/user'),
apiRoute = require('./routes/api'),
feedsRoute = require('./routes/feeds'),
metaRoute = require('./routes/meta');
metaRoute = require('./routes/meta'),
pluginsRoute = require('./routes/plugins');
if(nconf.get('ssl')) {
server = require('https').createServer({
@ -312,7 +313,7 @@ process.on('uncaughtException', function(err) {
// Theme's static directory
if (themeData['theme:staticDir']) {
app.use('/css/assets', express.static(path.join(nconf.get('themes_path'), themeData['theme:id'], themeData['theme:staticDir']), {
app.use(nconf.get('relative_path') + '/css/assets', express.static(path.join(nconf.get('themes_path'), themeData['theme:id'], themeData['theme:staticDir']), {
maxAge: app.enabled('cache') ? 5184000000 : 0
}));
if (process.env.NODE_ENV === 'development') {
@ -321,7 +322,7 @@ process.on('uncaughtException', function(err) {
}
if (themeData['theme:templates']) {
app.use('/templates', express.static(path.join(nconf.get('themes_path'), themeData['theme:id'], themeData['theme:templates']), {
app.use(nconf.get('relative_path') + '/templates', express.static(path.join(nconf.get('themes_path'), themeData['theme:id'], themeData['theme:templates']), {
maxAge: app.enabled('cache') ? 5184000000 : 0
}));
if (process.env.NODE_ENV === 'development') {
@ -493,6 +494,7 @@ process.on('uncaughtException', function(err) {
userRoute.createRoutes(app);
apiRoute.createRoutes(app);
feedsRoute.createRoutes(app);
pluginsRoute.createRoutes(app);
// Basic Routes (entirely client-side parsed, goal is to move the rest of the crap in this file into this one section)
(function () {
@ -939,9 +941,6 @@ process.on('uncaughtException', function(err) {
});
});
// Other routes
require('./routes/plugins')(app);
// Debug routes
if (process.env.NODE_ENV === 'development') {
require('./routes/debug')(app);

Loading…
Cancel
Save