From 948ace84c3c3532940150072167ede21ef51a1cc Mon Sep 17 00:00:00 2001 From: Tamir Gershberg <47638346+tamirGer@users.noreply.github.com> Date: Wed, 13 Mar 2024 23:09:42 +0200 Subject: [PATCH] fix(directory_listing): `/vendor/` should list the directory (#322) --- Dockerfile | 2 -- src/main.ts | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2217e79f..b89d687d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,8 +84,6 @@ COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules COPY --chown=node:node --from=build /usr/src/app/package*.json ./ COPY --chown=node:node --from=build /usr/src/app/dist ./dist -COPY --chown=node:node --from=build /usr/src/app/client/node_modules ./client/node_modules -COPY --chown=node:node --from=build /usr/src/app/client/package*.json ./client/ COPY --chown=node:node --from=build /usr/src/app/client/build ./client/build COPY --chown=node:node --from=build /usr/src/app/client/vcs ./client/vcs diff --git a/src/main.ts b/src/main.ts index 329e5fb6..ac4a1a59 100644 --- a/src/main.ts +++ b/src/main.ts @@ -106,6 +106,19 @@ async function bootstrap() { }); } + server.register(fastifyStatic, { + root: join(__dirname, '..', 'client', 'build', 'vendor'), + prefix: `/vendor`, + decorateReply: false, + redirect: true, + index: false, + list: { + format: 'html', + render: renderDirList, + }, + serveDotFiles: true, + }); + const app: NestFastifyApplication = await NestFactory.create( AppModule, new FastifyAdapter(server),