mirror of https://gitee.com/bigwinds/arangodb
System API docs should use active database
This commit is contained in:
parent
9d9ade7602
commit
d66616d620
|
@ -1,5 +1,5 @@
|
||||||
/*jshint globalstrict: true */
|
|
||||||
/*global applicationContext*/
|
/*global applicationContext*/
|
||||||
|
"use strict";
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief A Foxx.Controller to show all Foxx Applications
|
/// @brief A Foxx.Controller to show all Foxx Applications
|
||||||
|
@ -28,25 +28,19 @@
|
||||||
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var Foxx = require("org/arangodb/foxx");
|
var Foxx = require("org/arangodb/foxx");
|
||||||
var publicController = new Foxx.Controller(applicationContext);
|
var publicController = new Foxx.Controller(applicationContext);
|
||||||
var controller = new Foxx.Controller(applicationContext);
|
var controller = new Foxx.Controller(applicationContext);
|
||||||
var underscore = require("underscore");
|
var underscore = require("underscore");
|
||||||
var cluster = require("org/arangodb/cluster");
|
var cluster = require("org/arangodb/cluster");
|
||||||
var joi = require("joi");
|
var joi = require("joi");
|
||||||
var util = require("util");
|
|
||||||
var internal = require("internal");
|
var internal = require("internal");
|
||||||
var notifications = require("org/arangodb/configuration").notifications;
|
var notifications = require("org/arangodb/configuration").notifications;
|
||||||
var db = require("org/arangodb").db;
|
var db = require("org/arangodb").db;
|
||||||
var foxxInstallKey = joi.string().required().description(
|
|
||||||
"The _key attribute, where the information of this Foxx-Install is stored."
|
|
||||||
);
|
|
||||||
|
|
||||||
var foxxes = new (require("./lib/foxxes").Foxxes)();
|
|
||||||
var FoxxManager = require("org/arangodb/foxx/manager");
|
|
||||||
var UnauthorizedError = require("http-errors").Unauthorized;
|
var UnauthorizedError = require("http-errors").Unauthorized;
|
||||||
|
var API_DOCS = require(applicationContext.fileName("api-docs.json"));
|
||||||
|
API_DOCS.basePath = "/_db/" + encodeURIComponent(db._name());
|
||||||
|
|
||||||
publicController.activateSessions({
|
publicController.activateSessions({
|
||||||
autoCreateSession: false,
|
autoCreateSession: false,
|
||||||
|
@ -132,8 +126,7 @@ controller.allRoutes
|
||||||
|
|
||||||
controller.apiDocumentation('/api', {
|
controller.apiDocumentation('/api', {
|
||||||
swaggerJson(req, res) {
|
swaggerJson(req, res) {
|
||||||
var filename = applicationContext.fileName('api-docs.json');
|
res.json(API_DOCS);
|
||||||
res.sendFile(filename, {lastModified: true});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue