forked from NodeBB/nodebb-plugin-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
library.js
31 lines (22 loc) · 853 Bytes
/
library.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict';
const controllers = require('./lib/controllers');
const plugin = {};
plugin.init = function (params, callback) {
const router = params.router;
const hostMiddleware = params.middleware;
// const hostControllers = params.controllers;
// We create two routes for every view. One API call, and the actual route itself.
// Just add the buildHeader middleware to your route and NodeBB will take care of everything for you.
router.get('/admin/plugins/quickstart', hostMiddleware.admin.buildHeader, controllers.renderAdminPage);
router.get('/api/admin/plugins/quickstart', controllers.renderAdminPage);
callback();
};
plugin.addAdminNavigation = function (header, callback) {
header.plugins.push({
route: '/plugins/quickstart',
icon: 'fa-tint',
name: 'Quickstart',
});
callback(null, header);
};
module.exports = plugin;