mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-20 06:29:53 +01:00
Added nextjs.
This commit is contained in:
parent
04cc3c8d54
commit
55d41067b9
4 changed files with 25 additions and 1 deletions
|
@ -2,7 +2,10 @@
|
|||
import {ArgsExpressType} from "../../types/ArgsExpressType";
|
||||
|
||||
const eejs = require('../../eejs');
|
||||
import next from 'next'
|
||||
|
||||
const app = next({dev: process.env.NODE_ENV !== 'production'})
|
||||
const handle = app.getRequestHandler()
|
||||
/**
|
||||
* Add the admin navigation link
|
||||
* @param hookName {String} the name of the hook
|
||||
|
@ -11,6 +14,15 @@ const eejs = require('../../eejs');
|
|||
* @return {*}
|
||||
*/
|
||||
exports.expressCreateServer = (hookName:string, args: ArgsExpressType, cb:Function): any => {
|
||||
|
||||
args.app.get('/admin-new', (req:any, res:any) => {
|
||||
return app.render(req, res, '/admin', req.query)
|
||||
})
|
||||
|
||||
args.app.all('/admin/*', (req:any, res:any) => {
|
||||
return handle(req, res)
|
||||
})
|
||||
|
||||
args.app.get('/admin', (req:any, res:any) => {
|
||||
if ('/' !== req.path[req.path.length - 1]) return res.redirect('./admin/');
|
||||
res.send(eejs.require('ep_etherpad-lite/templates/admin/index.html', {req}));
|
||||
|
|
|
@ -54,9 +54,12 @@
|
|||
"log4js": "^6.9.1",
|
||||
"measured-core": "^2.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
"next": "^14.1.0",
|
||||
"openapi-backend": "^5.10.6",
|
||||
"proxy-addr": "^2.0.7",
|
||||
"rate-limiter-flexible": "^5.0.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"rehype": "^13.0.1",
|
||||
"rehype-minify-whitespace": "^6.0.0",
|
||||
"resolve": "1.22.8",
|
||||
|
|
7
src/pages/Admin.tsx
Normal file
7
src/pages/Admin.tsx
Normal file
|
@ -0,0 +1,7 @@
|
|||
export const Admin = ()=>{
|
||||
return(
|
||||
<div>
|
||||
<h1>Admin</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -12,6 +12,8 @@
|
|||
/* Type Checking */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
/* Completeness */
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
"skipLibCheck": true,
|
||||
/* Skip type checking all .d.ts files. */
|
||||
"jsx": "react"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue