2021-01-21 21:06:52 +00:00
|
|
|
'use strict';
|
2024-02-05 21:13:02 +01:00
|
|
|
import {ArgsExpressType} from "../../types/ArgsExpressType";
|
2012-11-05 12:58:02 +00:00
|
|
|
|
2024-02-05 21:13:02 +01:00
|
|
|
const eejs = require('../../eejs');
|
2023-10-17 12:49:56 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add the admin navigation link
|
|
|
|
* @param hookName {String} the name of the hook
|
|
|
|
* @param args {Object} the object containing the arguments
|
|
|
|
* @param {Function} cb the callback function
|
|
|
|
* @return {*}
|
|
|
|
*/
|
2024-02-05 21:13:02 +01:00
|
|
|
exports.expressCreateServer = (hookName:string, args: ArgsExpressType, cb:Function): any => {
|
|
|
|
args.app.get('/admin', (req:any, res:any) => {
|
2021-01-21 21:06:52 +00:00
|
|
|
if ('/' !== req.path[req.path.length - 1]) return res.redirect('./admin/');
|
2020-10-31 20:15:27 -04:00
|
|
|
res.send(eejs.require('ep_etherpad-lite/templates/admin/index.html', {req}));
|
2012-11-01 19:45:26 +01:00
|
|
|
});
|
2020-10-10 22:51:26 -04:00
|
|
|
return cb();
|
2020-11-23 13:24:19 -05:00
|
|
|
};
|