Added basic app.

This commit is contained in:
SamTV12345 2024-03-18 19:04:59 +01:00
parent b3741470ed
commit 3e18f65d3b
17 changed files with 581 additions and 382 deletions

View file

@ -73,12 +73,13 @@ exports.expressPreSession = async (hookName:string, {app}:any) => {
exports.expressCreateServer = (hookName:string, args:any, cb:Function) => {
// serve index.html under /
args.app.get('/', (req:any, res:any) => {
console.log('GET /')
res.type('text/html').send(eejs.require('ep_etherpad-lite/templates/index.html', {req}))
//res.send(eejs.require('ep_etherpad-lite/templates/index.html', {req}));
});
// serve pad.html under /p
args.app.get('/p/:pad', (req:any, res:any, next:Function) => {
args.app.get('/p/:pad', (req:any, res:any) => {
// The below might break for pads being rewritten
const isReadOnly = !webaccess.userCanModify(req.params.pad, req);
@ -97,7 +98,7 @@ exports.expressCreateServer = (hookName:string, args:any, cb:Function) => {
});
// serve timeslider.html under /p/$padname/timeslider
args.app.get('/p/:pad/timeslider', (req:any, res:any, next:Function) => {
args.app.get('/p/:pad/timeslider', (req:any, res:any) => {
hooks.callAll('padInitToolbar', {
toolbar,
});