Created
July 30, 2020 22:07
-
-
Save SergeyMell/e76957110984b550c03526cffcba75f5 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 { Database, Resource } from 'admin-bro-typeorm'; | |
import AdminBro from 'admin-bro'; | |
import * as AdminBroExpress from 'admin-bro-expressjs'; | |
export async function setupAdminPanel(app: INestApplication): Promise<void> { | |
/** | |
* Register TypeORM adapter for using | |
*/ | |
AdminBro.registerAdapter({ Database, Resource }); | |
const adminBro = new AdminBro({ | |
resources: [], | |
rootPath: '/admin', | |
}); | |
const router = AdminBroExpress.buildRouter(adminBro); | |
app.use(adminBro.options.rootPath, router); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment