Created
July 30, 2020 21:28
-
-
Save SergeyMell/94cd0bbbc5ab3f5881d893fadec9f33b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { INestApplication } from '@nestjs/common'; | |
import AdminBro from 'admin-bro'; | |
import * as AdminBroExpress from 'admin-bro-expressjs'; | |
export async function setupAdminPanel(app: INestApplication): Promise<void> { | |
/** Create adminBro instance */ | |
const adminBro = new AdminBro({ | |
resources: [], // Here we will put resources | |
rootPath: '/admin', // Define path for the admin panel | |
}); | |
/** Create router */ | |
const router = AdminBroExpress.buildRouter(adminBro); | |
/** Bind routing */ | |
app.use(adminBro.options.rootPath, router); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment