1
0
Fork 0

app -> service

This commit is contained in:
Alan Plum 2016-10-20 15:07:40 +02:00
parent c76af3012b
commit 6aaa55f9dc
No known key found for this signature in database
GPG Key ID: 8ED72A9A323B6EFD
3 changed files with 21 additions and 21 deletions

View File

@ -34,7 +34,7 @@ var foxxManager = require('@arangodb/foxx/manager');
var easyPostCallback = actions.easyPostCallback;
// //////////////////////////////////////////////////////////////////////////////
// / @brief sets up a Foxx application
// / @brief sets up a Foxx service
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
@ -52,7 +52,7 @@ actions.defineHttp({
});
// //////////////////////////////////////////////////////////////////////////////
// / @brief tears down a Foxx application
// / @brief tears down a Foxx service
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
@ -70,7 +70,7 @@ actions.defineHttp({
});
// //////////////////////////////////////////////////////////////////////////////
// / @brief installs a Foxx application
// / @brief installs a Foxx service
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
@ -89,7 +89,7 @@ actions.defineHttp({
});
// //////////////////////////////////////////////////////////////////////////////
// / @brief uninstalls a Foxx application
// / @brief uninstalls a Foxx service
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
@ -108,7 +108,7 @@ actions.defineHttp({
});
// //////////////////////////////////////////////////////////////////////////////
// / @brief replaces a Foxx application
// / @brief replaces a Foxx service
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
@ -128,7 +128,7 @@ actions.defineHttp({
});
// //////////////////////////////////////////////////////////////////////////////
// / @brief upgrades a Foxx application
// / @brief upgrades a Foxx service
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
@ -148,7 +148,7 @@ actions.defineHttp({
});
// //////////////////////////////////////////////////////////////////////////////
// / @brief configures a Foxx application
// / @brief configures a Foxx service
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
@ -170,7 +170,7 @@ actions.defineHttp({
});
// //////////////////////////////////////////////////////////////////////////////
// / @brief Gets the configuration of a Foxx application
// / @brief Gets the configuration of a Foxx service
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
@ -188,7 +188,7 @@ actions.defineHttp({
});
// //////////////////////////////////////////////////////////////////////////////
// / @brief configures a Foxx application's dependencies
// / @brief configures a Foxx service's dependencies
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
@ -207,7 +207,7 @@ actions.defineHttp({
});
// //////////////////////////////////////////////////////////////////////////////
// / @brief Gets the dependencies of a Foxx application
// / @brief Gets the dependencies of a Foxx service
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({
@ -225,7 +225,7 @@ actions.defineHttp({
});
// //////////////////////////////////////////////////////////////////////////////
// / @brief Toggles the development mode of a foxx application
// / @brief Toggles the development mode of a foxx service
// //////////////////////////////////////////////////////////////////////////////
actions.defineHttp({

View File

@ -984,15 +984,15 @@ function foxxRouting (req, res, options, next) {
var mount = options.mount;
try {
var app = foxxManager.lookupService(mount);
var devel = app.isDevelopment;
var service = foxxManager.lookupService(mount);
var devel = service.isDevelopment;
if (devel || !options.hasOwnProperty('routing')) {
delete options.error;
if (devel) {
foxxManager.rescanFoxx(mount); // TODO can move this to somewhere else?
app = foxxManager.lookupService(mount);
service = foxxManager.lookupService(mount);
}
options.routing = flattenRoutingTree(buildRoutingTree([foxxManager.routes(mount)]));

View File

@ -24,23 +24,23 @@ describe('Foxx Manager', function () {
var deps1 = {hello: {name: 'world', required: true, version: '*'}};
var deps2 = {clobbered: {name: 'completely', required: true, version: '*'}};
var app = FoxxManager.lookupService(mount);
expect(app.manifest.dependencies).to.eql({});
var filename = app.main.context.fileName('manifest.json');
var service = FoxxManager.lookupService(mount);
expect(service.manifest.dependencies).to.eql({});
var filename = service.main.context.fileName('manifest.json');
var rawJson = fs.readFileSync(filename, 'utf-8');
var json = JSON.parse(rawJson);
json.dependencies = deps1;
fs.writeFileSync(filename, JSON.stringify(json));
FoxxManager.scanFoxx(mount, {replace: true});
app = FoxxManager.lookupService(mount);
expect(app.manifest.dependencies).to.eql(deps1);
service = FoxxManager.lookupService(mount);
expect(service.manifest.dependencies).to.eql(deps1);
json.dependencies = deps2;
fs.writeFileSync(filename, JSON.stringify(json));
FoxxManager.scanFoxx(mount, {replace: true});
app = FoxxManager.lookupService(mount);
expect(app.manifest.dependencies).to.eql(deps2);
service = FoxxManager.lookupService(mount);
expect(service.manifest.dependencies).to.eql(deps2);
});
});
});