multica/src/gateway/app.module.ts
yushen 0f8db7083c fix(gateway): serve PWA client under /client subpath
Move static files from / to /client to avoid conflicts with
WebSocket and existing HTTP endpoints. Update manifest, service
worker, and HTML asset references accordingly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:35:40 +08:00

38 lines
1 KiB
TypeScript

import { Module } from "@nestjs/common";
import { ServeStaticModule } from "@nestjs/serve-static";
import { LoggerModule } from "nestjs-pino";
import { join } from "node:path";
import { fileURLToPath } from "node:url";
import { EventsGateway } from "./events.gateway.js";
import { AppController } from "./app.controller.js";
const __dirname = fileURLToPath(new URL(".", import.meta.url));
const isDev = process.env.NODE_ENV !== "production";
@Module({
imports: [
ServeStaticModule.forRoot({
rootPath: join(__dirname, "public"),
serveRoot: "/client",
}),
LoggerModule.forRoot({
pinoHttp: isDev
? {
transport: {
target: "pino-pretty",
options: {
colorize: true,
singleLine: true,
},
},
level: process.env.LOG_LEVEL ?? "debug",
}
: {
level: process.env.LOG_LEVEL ?? "info",
},
}),
],
providers: [EventsGateway],
controllers: [AppController],
})
export class AppModule {}