Просмотр исходного кода

:fire: removing our plugin example

master
j 5 лет назад
Родитель
Сommit
540fac3eb2
3 измененных файлов: 0 добавлений и 49 удалений
  1. 0
    5
      backend/lib/index.js
  2. 0
    16
      backend/lib/plugins/example.js
  3. 0
    28
      backend/lib/routes/example/base.js

+ 0
- 5
backend/lib/index.js Просмотреть файл

@@ -2,7 +2,6 @@ const UserPlugin = require('./plugins/user')
2 2
 const MembershipPlugin = require('./plugins/membership')
3 3
 const SurveyPlugin = require('./plugins/survey')
4 4
 const ProfilePlugin = require('./plugins/profile')
5
-const TestPlugin = require('./plugins/example')
6 5
 
7 6
 /**
8 7
  * A Hapi server instance
@@ -24,10 +23,6 @@ exports.plugin = {
24 23
      * @param {Object} options
25 24
      */
26 25
     register: async (server, options) => {
27
-        await server.register(TestPlugin, {
28
-            routes: { prefix: '/example' },
29
-        })
30
-
31 26
         await server.register(UserPlugin, {
32 27
             routes: { prefix: '/user' },
33 28
         })

+ 0
- 16
backend/lib/plugins/example.js Просмотреть файл

@@ -1,16 +0,0 @@
1
-const example = require('../routes/example/base')
2
-
3
-module.exports = {
4
-    name: 'myPlugin',
5
-    version: '1.0.0',
6
-
7
-    /**
8
-     * Example route registration
9
-     * @param {Server} server
10
-     * @param {Object} options
11
-     */
12
-    register: async (server, options) => {
13
-        // Create a route for example
14
-        server.route(example)
15
-    },
16
-}

+ 0
- 28
backend/lib/routes/example/base.js Просмотреть файл

@@ -1,28 +0,0 @@
1
-module.exports = {
2
-    method: 'GET',
3
-    path: '/',
4
-
5
-    /**
6
-     * Our request hanlder callback
7
-     * @param {*} request
8
-     * @param {*} h
9
-     * @returns {Object}
10
-     */
11
-    handler: async function (request, h) {
12
-        return { test: 'hello, world' }
13
-    },
14
-
15
-    /**
16
-     * Our route options
17
-     * @param {string} description - Title for our swagger docs
18
-     * @param {string} notes - Subtitle for our swagger docs
19
-     * @param {Array} tags - Our tags
20
-     * @param {boolean} auth - The authentication scheme
21
-     */
22
-    options: {
23
-        description: 'Test',
24
-        notes: 'This is an example route',
25
-        tags: ['api'],
26
-        auth: false,
27
-    },
28
-}

Загрузка…
Отмена
Сохранить