Browse Source

refactor(nocodb): delete public middleware since it is included in Noco.ts

pull/5721/head
Wing-Kam Wong 1 year ago
parent
commit
edeae9bc06
  1. 7
      packages/nocodb/src/middlewares/public/public.middleware.spec.ts
  2. 14
      packages/nocodb/src/middlewares/public/public.middleware.ts

7
packages/nocodb/src/middlewares/public/public.middleware.spec.ts

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

14
packages/nocodb/src/middlewares/public/public.middleware.ts

@ -1,14 +0,0 @@
import { Injectable } from '@nestjs/common';
import type { NestMiddleware } from '@nestjs/common';
@Injectable()
export class PublicMiddleware implements NestMiddleware {
use(req: any, res: any, next: () => void) {
// redirect root to dashboard
if (req.path === '/') {
const dashboardPath = process.env.NC_DASHBOARD_URL || '/dashboard';
return res.redirect(dashboardPath);
}
next();
}
}
Loading…
Cancel
Save