};
return dirMap[extension.location];
};
- var useClientDir = function (path, dir) {
+ var useClientDir = X.useClientDir = function (path, dir) {
path = path.indexOf("npm") === 0 ? "/" + path : path;
_.each(X.options.datasource.databases, function (orgValue, orgKey, orgList) {
app.use("/" + orgValue + path, express.static(dir, { maxAge: 86400000 }));
database: database,
extension: path.join(__dirname, "../../node_modules", extensionName)
}, callback);
+ },
+ // make the client-side assets immediately available to the webserver
+ // without the need for a datasource restart
+ useClientDir = function (callback) {
+ X.useClientDir("npm/" + extensionName + "/client",
+ path.join(__dirname, "../../node_modules", extensionName, "client"));
+ callback();
};
async.series([
validateUser,
npmLoad,
npmInstall,
- buildExtension
+ buildExtension,
+ useClientDir
], function (err, results) {
if (err) {
console.log(err);