mirror of https://github.com/nocodb/nocodb
2 changed files with 0 additions and 21 deletions
@ -1,7 +0,0 @@
|
||||
import { PublicMiddleware } from './public.middleware'; |
||||
|
||||
describe('PublicMiddleware', () => { |
||||
it('should be defined', () => { |
||||
expect(new PublicMiddleware()).toBeDefined(); |
||||
}); |
||||
}); |
@ -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…
Reference in new issue