Browse Source

fix(nocodb): move the logic to Noco.ts

pull/5721/head
Wing-Kam Wong 1 year ago
parent
commit
231df22ca1
  1. 10
      packages/nocodb/src/middlewares/public/public.middleware.ts

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

@ -1,7 +1,4 @@
import path, { join } from 'path';
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import express from 'express';
import isDocker from 'is-docker';
import type { NestMiddleware } from '@nestjs/common'; import type { NestMiddleware } from '@nestjs/common';
@Injectable() @Injectable()
@ -12,12 +9,5 @@ export class PublicMiddleware implements NestMiddleware {
const dashboardPath = process.env.NC_DASHBOARD_URL || '/dashboard'; const dashboardPath = process.env.NC_DASHBOARD_URL || '/dashboard';
return res.redirect(dashboardPath); return res.redirect(dashboardPath);
} }
// serve static files from public folder
if (isDocker()) {
express.static(join(process.cwd(), 'docker', 'public'))(req, res, next);
} else {
express.static(join(process.cwd(), 'public'))(req, res, next);
}
} }
} }

Loading…
Cancel
Save