fixed another hardcoded prefix value

This commit is contained in:
Julian Lam
2014-05-30 17:11:37 -04:00
parent 86457558b0
commit b0464ff912

View File

@@ -34,10 +34,11 @@ function setupPluginSourceMapping(app) {
development mode (`./nodebb dev`)
*/
var routes = plugins.clientScripts,
mapping;
mapping,
prefix = __dirname.split(path.sep).length - 1;
routes.forEach(function(route) {
mapping = '/' + route.split('/').slice(7).join('/');
mapping = '/' + route.split('/').slice(prefix).join('/');
app.get(mapping, function(req, res) {
res.type('text/javascript').sendfile(route);
});