Browse Source

fix(nocodb): incorrect public path for docker

pull/5693/head
Wing-Kam Wong 1 year ago
parent
commit
5a140ea2a9
  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 express from 'express';
import isDocker from 'is-docker';
import type { NestMiddleware } from '@nestjs/common';
@Injectable()
@ -13,6 +14,10 @@ export class PublicMiddleware implements NestMiddleware {
}
// 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