mirror of https://github.com/nocodb/nocodb
Pranav C
2 years ago
2 changed files with 17 additions and 0 deletions
@ -0,0 +1,7 @@
|
||||
import { GuiMiddleware } from './gui.middleware'; |
||||
|
||||
describe('GuiMiddleware', () => { |
||||
it('should be defined', () => { |
||||
expect(new GuiMiddleware()).toBeDefined(); |
||||
}); |
||||
}); |
@ -0,0 +1,10 @@
|
||||
import { Injectable, NestMiddleware } from '@nestjs/common' |
||||
import NcToolGui from 'nc-lib-gui' |
||||
|
||||
@Injectable() |
||||
export class GuiMiddleware implements NestMiddleware { |
||||
use(req: any, res: any, next: () => void) { |
||||
const dashboardPath = process.env.NC_DASHBOARD_URL || '/dashboard' |
||||
NcToolGui.expressMiddleware(dashboardPath)(req, res, next) |
||||
} |
||||
} |
Loading…
Reference in new issue