mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Added nanoexpress
This commit is contained in:
parent
1e91efc16c
commit
3c66e8c5d6
5 changed files with 51 additions and 4 deletions
|
@ -18,6 +18,7 @@ const settings = require('../utils/Settings');
|
|||
const stats = require('../stats')
|
||||
import util from 'util';
|
||||
const webaccess = require('./express/webaccess');
|
||||
import nanoexpress from 'nanoexpress';
|
||||
|
||||
import SecretRotator from '../security/SecretRotator';
|
||||
|
||||
|
@ -100,7 +101,7 @@ exports.createServer = async () => {
|
|||
exports.restartServer = async () => {
|
||||
await closeServer();
|
||||
|
||||
const app = express(); // New syntax for express v3
|
||||
const app = nanoexpress(); // New syntax for express v3
|
||||
|
||||
if (settings.ssl) {
|
||||
console.log('SSL -- enabled');
|
||||
|
|
|
@ -6,7 +6,7 @@ const padManager = require('../../db/PadManager');
|
|||
|
||||
exports.expressCreateServer = (hookName:string, args:ArgsExpressType, cb:Function) => {
|
||||
// redirects browser to the pad's sanitized url if needed. otherwise, renders the html
|
||||
args.app.param('pad', (req:any, res:any, next:Function, padId:string) => {
|
||||
/*args.app.param('pad', (req:any, res:any, next:Function, padId:string) => {
|
||||
(async () => {
|
||||
// ensure the padname is valid and the url doesn't end with a /
|
||||
if (!padManager.isValidPadId(padId) || /\/$/.test(req.url)) {
|
||||
|
@ -27,6 +27,6 @@ exports.expressCreateServer = (hookName:string, args:ArgsExpressType, cb:Functio
|
|||
res.status(302).send(`You should be redirected to <a href="${realURL}">${realURL}</a>`);
|
||||
}
|
||||
})().catch((err) => next(err || new Error(err)));
|
||||
});
|
||||
});*/
|
||||
return cb();
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ exports.expressPreSession = async (hookName:string, {app}:any) => {
|
|||
|
||||
// Minify will serve static files compressed (minify enabled). It also has
|
||||
// file-specific hacks for ace/require-kernel/etc.
|
||||
app.all('/static/:filename(*)', minify);
|
||||
app.get('/static/:filename(*)', minify);
|
||||
|
||||
// serve plugin definitions
|
||||
// not very static, but served here so that client can do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue