fix: server di error

This commit is contained in:
Draculabo authored and vin committed 2026-01-10 01:07:09 +08:00
1 parent bc775d4fd6
commit 098cbe3eb9
6 files changed
+1328 -13

No files matched your search

+1313 -9
View File
File diff suppressed because it is too large. Load diff
+5
View File
@@ -39,6 +39,7 @@
"@eslint/compat": "^1.4.1",
"@eslint/js": "^9.39.0",
"@playwright/test": "^1.56.1",
"@swc/core": "^1.15.8",
"@tanstack/router-plugin": "^1.135.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
@@ -69,6 +70,7 @@
"ts-node": "^10.9.2",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.3",
"unplugin-swc": "^1.5.9",
"vite": "^5.4.21",
"vitest": "^4.0.8"
},
@@ -76,7 +78,10 @@
"@icons-pack/react-simple-icons": "^13.8.0",
"@nestjs/common": "^11.1.10",
"@nestjs/core": "^11.1.10",
"@nestjs/microservices": "^11.1.11",
"@nestjs/platform-express": "^11.1.11",
"@nestjs/platform-fastify": "^11.1.10",
"@nestjs/websockets": "^11.1.11",
"@orpc/client": "^1.10.4",
"@orpc/server": "^1.11.3",
"@radix-ui/react-avatar": "^1.1.11",
+6 -2
View File
@@ -13,8 +13,12 @@ export const startGateway = async (port: number): Promise<boolean> => {
try {
// Stop if already running
await stopNestServer();
// Start NestJS server
return await bootstrapNestServer(port);
// Load full config and start NestJS server
const config = ConfigManager.loadConfig();
const proxyConfig = { ...config.proxy, port };
return await bootstrapNestServer(proxyConfig);
} catch (e) {
console.error('Failed to start gateway:', e);
return false;
+1
View File
@@ -1,3 +1,4 @@
import 'reflect-metadata';
import { NestFactory } from '@nestjs/core';
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
import { AppModule } from './app.module';
+2 -2
View File
@@ -1,4 +1,4 @@
import { Controller, Get, Post, Body, Res, HttpStatus, UseGuards } from '@nestjs/common';
import { Controller, Get, Post, Body, Res, HttpStatus, UseGuards, Inject } from '@nestjs/common';
import { FastifyReply } from 'fastify';
import { ProxyService } from './proxy.service';
import { Observable } from 'rxjs';
@@ -8,7 +8,7 @@ import { ProxyGuard } from './proxy.guard';
@Controller('v1')
@UseGuards(ProxyGuard)
export class ProxyController {
constructor(private readonly proxyService: ProxyService) {}
constructor(@Inject(ProxyService) private readonly proxyService: ProxyService) {}
@Get('models')
getModels() {
+1
View File
@@ -5,6 +5,7 @@
"module": "ESNext",
"lib": ["dom", "ESNext"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"composite": true,
"declaration": true,
"forceConsistentCasingInFileNames": true,