From f2eb2300f22788b3080f73862a079be2fafa49ef Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 12 Apr 2023 18:59:31 +0530 Subject: [PATCH] fix: serve nc-gui Signed-off-by: Pranav C --- packages/nocodb-nest/src/nocobuild.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/nocodb-nest/src/nocobuild.ts b/packages/nocodb-nest/src/nocobuild.ts index f4dfee52ac..80e70d7a11 100644 --- a/packages/nocodb-nest/src/nocobuild.ts +++ b/packages/nocodb-nest/src/nocobuild.ts @@ -1,11 +1,17 @@ import { NestFactory } from '@nestjs/core'; import express from 'express'; import { AppModule } from './app.module'; +import NcToolGui from 'nc-lib-gui' export default async function (app = express()) { const nestApp = await NestFactory.create(AppModule); await nestApp.init(); + const dashboardPath = process.env.NC_DASHBOARD_URL || '/dashboard'; + app.use(NcToolGui.expressMiddleware(dashboardPath)); + app.get('/', (_req, res) => + res.redirect(dashboardPath) + ); app.use(nestApp.getHttpAdapter().getInstance()); return app;