mirror of https://gitee.com/bigwinds/arangodb
Removed appId and inserted a action stub to register the routing table for one foxx app.
This commit is contained in:
parent
873a5b409e
commit
1e4ba6e09b
|
@ -2144,10 +2144,18 @@ function stringifyRequestAddress (req) {
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setFoxxRouting(mount, routes) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// --SECTION-- MODULE EXPORTS
|
// --SECTION-- MODULE EXPORTS
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Insert the routing information for one foxx application
|
||||||
|
|
||||||
|
exports.setFoxxRouting = setFoxxRouting;
|
||||||
|
|
||||||
// load all actions from the actions directory
|
// load all actions from the actions directory
|
||||||
exports.startup = startup;
|
exports.startup = startup;
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,6 @@
|
||||||
this.comments = [];
|
this.comments = [];
|
||||||
this.name = app._name;
|
this.name = app._name;
|
||||||
this.version = app._version;
|
this.version = app._version;
|
||||||
this.appId = app._id;
|
|
||||||
this.mount = app._mount;
|
this.mount = app._mount;
|
||||||
this.collectionPrefix = app._collectionPrefix;
|
this.collectionPrefix = app._collectionPrefix;
|
||||||
this.options = app._options;
|
this.options = app._options;
|
||||||
|
@ -108,7 +107,6 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
var ArangoApp = function (config) {
|
var ArangoApp = function (config) {
|
||||||
this._id = config.id; // ???
|
|
||||||
this._manifest = config.manifest;
|
this._manifest = config.manifest;
|
||||||
this._name = config.manifest.name;
|
this._name = config.manifest.name;
|
||||||
this._version = config.manifest.version;
|
this._version = config.manifest.version;
|
||||||
|
@ -121,6 +119,10 @@ var ArangoApp = function (config) {
|
||||||
this._exports = {};
|
this._exports = {};
|
||||||
this._collectionPrefix = this._mount.substr(1).replace(/-/g, "_").replace(/\//g, "_") + "_";
|
this._collectionPrefix = this._mount.substr(1).replace(/-/g, "_").replace(/\//g, "_") + "_";
|
||||||
this._context = new AppContext(this);
|
this._context = new AppContext(this);
|
||||||
|
|
||||||
|
if (this._manifest.hasOwnProperty("defaultDocument")) {
|
||||||
|
this._manifest.defaultDocument = "index.html";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
@ -145,7 +147,6 @@ var ArangoApp = function (config) {
|
||||||
|
|
||||||
ArangoApp.prototype.toJSON = function () {
|
ArangoApp.prototype.toJSON = function () {
|
||||||
var json = {
|
var json = {
|
||||||
id: this._id,
|
|
||||||
manifest: this._manifest,
|
manifest: this._manifest,
|
||||||
name: this._name,
|
name: this._name,
|
||||||
version: this._version,
|
version: this._version,
|
||||||
|
|
|
@ -101,7 +101,6 @@ Controller = function (context, options) {
|
||||||
options: {
|
options: {
|
||||||
name: context.name,
|
name: context.name,
|
||||||
version: context.version,
|
version: context.version,
|
||||||
appId: context.appId,
|
|
||||||
mount: context.mount,
|
mount: context.mount,
|
||||||
isDevelopment: context.isDevelopment,
|
isDevelopment: context.isDevelopment,
|
||||||
isProduction: context.isProduction,
|
isProduction: context.isProduction,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -39,6 +39,7 @@
|
||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
var frontendDevelopmentMode = require("internal").frontendDevelopmentMode;
|
var frontendDevelopmentMode = require("internal").frontendDevelopmentMode;
|
||||||
var console = require("console");
|
var console = require("console");
|
||||||
|
var setFoxxRouting = require("org/arangodb/actions").setFoxxRouting;
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// --SECTION-- private functions
|
// --SECTION-- private functions
|
||||||
|
@ -297,7 +298,7 @@
|
||||||
var i;
|
var i;
|
||||||
var mount = app._mount;
|
var mount = app._mount;
|
||||||
|
|
||||||
var defaultDocument = app._manifest.defaultDocument; // TODO by default "index.html"
|
var defaultDocument = app._manifest.defaultDocument;
|
||||||
|
|
||||||
// setup the routes
|
// setup the routes
|
||||||
var routes = {
|
var routes = {
|
||||||
|
@ -364,11 +365,9 @@
|
||||||
if (controllers.hasOwnProperty(i)) {
|
if (controllers.hasOwnProperty(i)) {
|
||||||
file = controllers[i];
|
file = controllers[i];
|
||||||
|
|
||||||
// TODO ????
|
|
||||||
// set up a context for the application start function
|
// set up a context for the application start function
|
||||||
tmpContext = {
|
tmpContext = {
|
||||||
prefix: arangodb.normalizeURL("/" + i), // app mount
|
prefix: arangodb.normalizeURL("/" + i), // app mount
|
||||||
routingInfo: {},
|
|
||||||
foxxes: []
|
foxxes: []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -423,6 +422,7 @@
|
||||||
// install all files and assets
|
// install all files and assets
|
||||||
installAssets(app, routes);
|
installAssets(app, routes);
|
||||||
|
|
||||||
|
setFoxxRouting(app._mount, routes);
|
||||||
// and return all routes
|
// and return all routes
|
||||||
return routes;
|
return routes;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue