Browse Source

fix: add gui middleware

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 2 years ago
parent
commit
431f066608
  1. 7
      packages/nocodb-nest/src/middlewares/gui/gui.middleware.spec.ts
  2. 10
      packages/nocodb-nest/src/middlewares/gui/gui.middleware.ts

7
packages/nocodb-nest/src/middlewares/gui/gui.middleware.spec.ts

@ -0,0 +1,7 @@
import { GuiMiddleware } from './gui.middleware';
describe('GuiMiddleware', () => {
it('should be defined', () => {
expect(new GuiMiddleware()).toBeDefined();
});
});

10
packages/nocodb-nest/src/middlewares/gui/gui.middleware.ts

@ -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…
Cancel
Save