Browse Source

Merge branch 'develop' into refactor/timezone-locale

pull/5719/head
Wing-Kam Wong 2 years ago
parent
commit
17fd0e66f7
  1. 9
      packages/nocodb/src/middlewares/public/public.middleware.ts

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

@ -1,6 +1,7 @@
import { join } from 'path'; import path, { join } from 'path';
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import express from 'express'; import express from 'express';
import isDocker from 'is-docker';
import type { NestMiddleware } from '@nestjs/common'; import type { NestMiddleware } from '@nestjs/common';
@Injectable() @Injectable()
@ -13,6 +14,10 @@ export class PublicMiddleware implements NestMiddleware {
} }
// serve static files from public folder // serve static files from public folder
express.static(join(process.cwd(), 'public'))(req, res, next); 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