From b4f99a39539c06dffbdefa2de3c1295ce7fdceb9 Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Thu, 14 Apr 2016 13:54:53 +0200 Subject: [PATCH] Remove unused Aardvark foxxTemplates.js --- .../_admin/aardvark/APP/foxxTemplates.js | 58 ------------------- js/apps/system/_admin/aardvark/APP/index.js | 1 - 2 files changed, 59 deletions(-) delete mode 100644 js/apps/system/_admin/aardvark/APP/foxxTemplates.js diff --git a/js/apps/system/_admin/aardvark/APP/foxxTemplates.js b/js/apps/system/_admin/aardvark/APP/foxxTemplates.js deleted file mode 100644 index eac090fc4e..0000000000 --- a/js/apps/system/_admin/aardvark/APP/foxxTemplates.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -//////////////////////////////////////////////////////////////////////////////// -/// DISCLAIMER -/// -/// Copyright 2010-2014 triAGENS GmbH, Cologne, Germany -/// Copyright 2016 ArangoDB GmbH, Cologne, Germany -/// -/// Licensed under the Apache License, Version 2.0 (the "License"); -/// you may not use this file except in compliance with the License. -/// You may obtain a copy of the License at -/// -/// http://www.apache.org/licenses/LICENSE-2.0 -/// -/// Unless required by applicable law or agreed to in writing, software -/// distributed under the License is distributed on an "AS IS" BASIS, -/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -/// See the License for the specific language governing permissions and -/// limitations under the License. -/// -/// Copyright holder is ArangoDB GmbH, Cologne, Germany -/// -/// @author Michael Hackstein -/// @author Alan Plum -//////////////////////////////////////////////////////////////////////////////// - -const joi = require('joi'); -const httperr = require('http-errors'); -const internal = require('internal'); -const FoxxManager = require('@arangodb/foxx/manager'); -const createRouter = require('@arangodb/foxx/router'); - - -const router = createRouter(); -module.exports = router; - -router.use((req, res, next) => { - if (!internal.options()['server.disable-authentication'] && !req.session.uid) { - throw new httperr.Unauthorized(); - } - next(); -}); - -router.get('/devMode', (req, res) => res.json(false)); - -router.post('/generate', (req, res) => res.json( - FoxxManager.install('EMPTY', '/todo', req.body) -)) -.body(joi.object({ - applicationContext: joi.string().optional(), - path: joi.string().optional(), - name: joi.string().required(), - collectionNames: joi.array().required(), - authenticated: joi.boolean().required(), - author: joi.string().required(), - description: joi.string().required(), - license: joi.string().required() -}), 'The configuration for the template.'); diff --git a/js/apps/system/_admin/aardvark/APP/index.js b/js/apps/system/_admin/aardvark/APP/index.js index 6f7d949d1c..202e5818a3 100644 --- a/js/apps/system/_admin/aardvark/APP/index.js +++ b/js/apps/system/_admin/aardvark/APP/index.js @@ -41,4 +41,3 @@ module.context.use(require('./aardvark')); module.context.use('/foxxes', require('./foxxes')); module.context.use('/cluster', require('./cluster')); module.context.use('/statistics', require('./statistics')); -module.context.use('/templates', require('./foxxTemplates'));