Browse Source

Merge pull request #5693 from nocodb/fix/swagger-ui

fix(nocodb): incorrect public path for docker
pull/5695/head
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
c58e44d83a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/nocodb/src/middlewares/public/public.middleware.ts

7
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
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