REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 4.71 KB
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/backend/utils/router/router.js
Text
Base64
import path from 'path'; import * as url from 'url'; import { createRequire } from 'node:module'; import AppController from '../../controllers/app-controller.js'; import ApiController from '../../controllers/api-controller.js'; import { COMPONENTS_OUTPUT_PATH, NODE_ENV } from '../../bundler/utils/constants.js'; const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); const ASSETS_ROOT = `${__dirname}/../lib/../../../frontend/assets/`; /** * A function which resolves the path to AdminJS design system bundle. * * @returns {string} resolved path to AdminJS design system bundle */ const resolveDesignSystemBundle = () => { const require = createRequire(import.meta.url); return path.join(path.parse(require.resolve('@adminjs/design-system')).dir, `../bundle.${NODE_ENV}.js`); }; /** * Type representing the AdminJS.Router * @memberof Router * @alias RouterType */ /** * @load ./router.doc.md * @namespace */ export const Router = { assets: [{ path: '/frontend/assets/icomoon.css', src: path.join(ASSETS_ROOT, 'styles/icomoon.css') }, { path: '/frontend/assets/icomoon.eot', src: path.join(ASSETS_ROOT, 'fonts/icomoon.eot') }, { path: '/frontend/assets/icomoon.svg', src: path.join(ASSETS_ROOT, 'fonts/icomoon.svg') }, { path: '/frontend/assets/icomoon.ttf', src: path.join(ASSETS_ROOT, 'fonts/icomoon.ttf') }, { path: '/frontend/assets/icomoon.woff', src: path.join(ASSETS_ROOT, 'fonts/icomoon.woff') }, { path: '/frontend/assets/app.bundle.js', src: path.join(ASSETS_ROOT, `scripts/app-bundle.${NODE_ENV}.js`) }, { path: '/frontend/assets/global.bundle.js', src: path.join(ASSETS_ROOT, `scripts/global-bundle.${NODE_ENV}.js`) }, { path: '/frontend/assets/design-system.bundle.js', src: resolveDesignSystemBundle() }, { path: '/frontend/assets/logo.svg', src: path.join(ASSETS_ROOT, 'images/logo.svg') }, { path: '/frontend/assets/logo-mini.svg', src: path.join(ASSETS_ROOT, 'images/logo-mini.svg') }], routes: [{ method: 'GET', path: '', Controller: AppController, action: 'index' }, { method: 'GET', path: '/resources/{resourceId}', Controller: AppController, action: 'resource' }, { method: 'GET', path: '/api/resources/{resourceId}/search/{query}', Controller: ApiController, action: 'search' }, { method: 'GET', path: '/resources/{resourceId}/actions/{action}', Controller: AppController, action: 'resourceAction' }, { method: 'GET', path: '/api/resources/{resourceId}/actions/{action}', Controller: ApiController, action: 'resourceAction' }, { method: 'GET', path: '/api/resources/{resourceId}/actions/{action}/{query}', Controller: ApiController, action: 'resourceAction' }, { method: 'POST', path: '/api/resources/{resourceId}/actions/{action}', Controller: ApiController, action: 'resourceAction' }, { method: 'GET', path: '/resources/{resourceId}/records/{recordId}/{action}', Controller: AppController, action: 'recordAction' }, { method: 'GET', path: '/api/resources/{resourceId}/records/{recordId}/{action}', Controller: ApiController, action: 'recordAction' }, { method: 'POST', path: '/api/resources/{resourceId}/records/{recordId}/{action}', Controller: ApiController, action: 'recordAction' }, { method: 'GET', path: '/resources/{resourceId}/bulk/{action}', Controller: AppController, action: 'bulkAction' }, { method: 'GET', path: '/api/resources/{resourceId}/bulk/{action}', Controller: ApiController, action: 'bulkAction' }, { method: 'POST', path: '/api/resources/{resourceId}/bulk/{action}', Controller: ApiController, action: 'bulkAction' }, { method: 'GET', path: '/api/resources/{resourceId}/search', Controller: ApiController, action: 'search' }, { method: 'GET', path: '/api/dashboard', Controller: ApiController, action: 'dashboard' }, // Pages { method: 'GET', path: '/pages/{pageName}', Controller: AppController, action: 'page' }, { method: 'GET', path: '/api/pages/{pageName}', Controller: ApiController, action: 'page' }, { method: 'POST', path: '/api/pages/{pageName}', Controller: ApiController, action: 'page' }] }; if (process.env.NODE_ENV === 'production') { Router.assets.push({ path: '/frontend/assets/components.bundle.js', src: COMPONENTS_OUTPUT_PATH }); } else { Router.routes.push({ method: 'GET', path: '/frontend/assets/components.bundle.js', Controller: AppController, action: 'bundleComponents', contentType: 'text/javascript;charset=utf-8' }); } export default Router;
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
index.js
28 B
lrw-r--r--
2026-02-28 00:31:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
router.doc.md
2.25 KB
lrw-r--r--
2026-02-28 00:31:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
router.js
4.71 KB
lrw-r--r--
2026-02-28 00:31:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
router.spec.js
484 B
lrw-r--r--
2026-02-28 00:31:48
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).