REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.68 KB
Close
/home/byroehnu/easepay.easetack.com/node_modules/@adminjs/express/lib/index.d.ts
Text
Base64
import { buildAuthenticatedRouter } from "./buildAuthenticatedRouter.js"; import { buildRouter } from "./buildRouter.js"; /** * @module @adminjs/express * @subcategory Plugins * @section modules * * @classdesc * Plugin that allows you to add AdminJS to Express.js applications. * * ## Installation * * ```sh * npm install @adminjs/express * ``` * * It has 2 peerDependencies: `express-formidable` and `express`, * so you have to install them as well (if they are not installed already) * * ``` * npm install express express-formidable * ``` * * ## Usage * * ``` * const AdminJSExpress = require('@adminjs/express') * ``` * * It exposes 2 methods that create an Express Router, which can be attached * to a given url in the API. Each method takes a pre-configured instance of {@link AdminJS}. * * - {@link module:@adminjs/express.buildRouter AdminJSExpress.buildRouter(admin, [predefinedRouter])} * - {@link module:@adminjs/express.buildAuthenticatedRouter AdminJSExpress.buildAuthenticatedRouter(admin, auth, [predefinedRouter], sessionOptions)} * * If you want to use a router you have already created - not a problem. Just pass it * as a `predefinedRouter` parameter. * * You may want to use this option when you want to include * some custom auth middleware for you AdminJS routes. * * ## Example without an authentication * * ``` * const AdminJS = require('adminjs') * const AdminJSExpress = require('@adminjs/express') * * const express = require('express') * const app = express() * * const adminJs = new AdminJS({ * databases: [], * rootPath: '/admin', * }) * * const router = AdminJSExpress.buildRouter(adminJs) * app.use(adminJs.options.rootPath, router) * app.listen(8080, () => console.log('AdminJS is running under localhost:8080/admin')) * ``` * * ## Using build in authentication * * To protect the routes with a session authentication, you can use predefined * {@link module:@adminjs/express.buildAuthenticatedRouter} method. * * Note! To use authentication in production environment, there is a need to configure * express-session for production build. It can be achieved by passing options to * `sessionOptions` parameter. Read more on [express/session Github page](https://github.com/expressjs/session) * * ## Adding custom authentication * * You can add your custom authentication setup by firstly creating the router and then * passing it via the `predefinedRouter` option. * * ``` * let router = express.Router() * router.use((req, res, next) => { * if (req.session && req.session.admin) { * req.session.adminUser = req.session.admin * next() * } else { * res.redirect(adminJs.options.loginPath) * } * }) * router = AdminJSExpress.buildRouter(adminJs, router) * ``` * * Where `req.session.admin` is {@link AdminJS#CurrentAdmin}, * meaning that it should have at least an email property. */ /** * Plugin name * @static * @memberof module:@adminjs/express */ export declare const name = "AdminJSExpressjs"; export { SessionData } from "express-session"; export type ExpressPlugin = { name: string; buildAuthenticatedRouter: typeof buildAuthenticatedRouter; buildRouter: typeof buildRouter; }; declare const plugin: ExpressPlugin; export default plugin; export type { AuthenticationOptions, FormidableOptions, AuthenticationMaxRetriesOptions, AuthenticationContext, } from "./types.js"; export * from "./buildRouter.js"; export * from "./buildAuthenticatedRouter.js"; export * from "./convertRoutes.js"; export * from "./errors.js"; export * from "./logger.js"; export * from "./authentication/login.handler.js"; export * from "./authentication/logout.handler.js"; export * from "./authentication/protected-routes.handler.js";
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 15
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
authentication
DIR
-
drwxr-xr-x
2026-03-14 01:49:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
.htaccess
127 B
lr--r--r--
2026-03-14 01:49:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
buildAuthenticatedRouter.d.ts
1.51 KB
lrw-r--r--
2026-02-28 00:28:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
buildAuthenticatedRouter.js
2.99 KB
lrw-r--r--
2026-02-28 00:27:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
buildRouter.d.ts
1.15 KB
lrw-r--r--
2026-02-28 00:28:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
buildRouter.js
3.08 KB
lrw-r--r--
2026-02-28 00:27:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
convertRoutes.d.ts
76 B
lrw-r--r--
2026-02-28 00:28:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
convertRoutes.js
102 B
lrw-r--r--
2026-02-28 00:27:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
errors.d.ts
491 B
lrw-r--r--
2026-02-28 00:28:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
errors.js
1.07 KB
lrw-r--r--
2026-02-28 00:27:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.d.ts
3.68 KB
lrw-r--r--
2026-02-28 00:28:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
3.41 KB
lrw-r--r--
2026-02-28 00:28:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
logger.d.ts
172 B
lrw-r--r--
2026-02-28 00:29:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
logger.js
255 B
lrw-r--r--
2026-02-28 00:28:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
types.d.ts
1.17 KB
lrw-r--r--
2026-02-28 00:29:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
types.js
11 B
lrw-r--r--
2026-02-28 00:28:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).