diff --git a/html/admin/swagger.html b/html/admin/swagger.html
index f063d40c5d..571bccbf2e 100644
--- a/html/admin/swagger.html
+++ b/html/admin/swagger.html
@@ -2,7 +2,7 @@
Swagger UI
-
+
diff --git a/js/apps/aardvark/index.html b/js/apps/aardvark/index.html
index 5a0e18321c..dea09d79e9 100644
--- a/js/apps/aardvark/index.html
+++ b/js/apps/aardvark/index.html
@@ -8,7 +8,7 @@
-
+
diff --git a/js/common/bootstrap/modules.js b/js/common/bootstrap/modules.js
index 9c6de855dd..ad8f12df15 100644
--- a/js/common/bootstrap/modules.js
+++ b/js/common/bootstrap/modules.js
@@ -1148,9 +1148,11 @@ function require (path) {
/// @brief loadAppScript
////////////////////////////////////////////////////////////////////////////////
- ArangoApp.prototype.loadAppScript = function (appModule, file, appContext, context) {
+ ArangoApp.prototype.loadAppScript = function (appModule, file, appContext, options) {
'use strict';
+ options = options || {};
+
var fileContent;
var full;
var key;
@@ -1158,6 +1160,10 @@ function require (path) {
try {
full = fs.join(this._root, this._path, file);
fileContent = fs.read(full);
+
+ if (options.hasOwnProperty('transform')) {
+ fileContent = options.transform(fileContent);
+ }
}
catch (err1) {
throw "cannot read file '" + full + "': " + err1 + " - " + err1.stack;
@@ -1165,7 +1171,9 @@ function require (path) {
var sandbox = {};
- if (context !== undefined) {
+ if (options.hasOwnProperty('context')) {
+ var context = options.context;
+
for (key in context) {
if (context.hasOwnProperty(key) && key !== "__myenv__") {
sandbox[key] = context[key];
diff --git a/js/server/modules/org/arangodb/foxx/transformer.js b/js/common/modules/org/arangodb/foxx/transformer.js
similarity index 100%
rename from js/server/modules/org/arangodb/foxx/transformer.js
rename to js/common/modules/org/arangodb/foxx/transformer.js
diff --git a/js/server/modules/org/arangodb/foxx-manager.js b/js/server/modules/org/arangodb/foxx-manager.js
index b328ecee82..81f004e799 100644
--- a/js/server/modules/org/arangodb/foxx-manager.js
+++ b/js/server/modules/org/arangodb/foxx-manager.js
@@ -35,6 +35,7 @@ var fs = require("fs");
var executeGlobalContextFunction = require("internal").executeGlobalContextFunction;
var checkParameter = arangodb.checkParameter;
+var transformScript = require("org/arangodb/foxx/transformer").transform;
// -----------------------------------------------------------------------------
// --SECTION-- private functions
@@ -517,7 +518,7 @@ function routingAalApp (app, mount, options) {
extendContext(context, app, root);
- app.loadAppScript(context.appModule, file, context);
+ app.loadAppScript(context.appModule, file, context, { transform: transformScript });
// .............................................................................
// routingInfo