fix: server di error
This commit is contained in:
1 parent
bc775d4fd6
commit
098cbe3eb9
6 files changed
+1328
-13
No files matched your search
Generated
+1313
-9
File diff suppressed because it is too large.
Load diff
@@ -39,6 +39,7 @@
|
|||||||
"@eslint/compat": "^1.4.1",
|
"@eslint/compat": "^1.4.1",
|
||||||
"@eslint/js": "^9.39.0",
|
"@eslint/js": "^9.39.0",
|
||||||
"@playwright/test": "^1.56.1",
|
"@playwright/test": "^1.56.1",
|
||||||
|
"@swc/core": "^1.15.8",
|
||||||
"@tanstack/router-plugin": "^1.135.0",
|
"@tanstack/router-plugin": "^1.135.0",
|
||||||
"@testing-library/jest-dom": "^6.9.1",
|
"@testing-library/jest-dom": "^6.9.1",
|
||||||
"@testing-library/react": "^16.3.0",
|
"@testing-library/react": "^16.3.0",
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"typescript-eslint": "^8.46.3",
|
"typescript-eslint": "^8.46.3",
|
||||||
|
"unplugin-swc": "^1.5.9",
|
||||||
"vite": "^5.4.21",
|
"vite": "^5.4.21",
|
||||||
"vitest": "^4.0.8"
|
"vitest": "^4.0.8"
|
||||||
},
|
},
|
||||||
@@ -76,7 +78,10 @@
|
|||||||
"@icons-pack/react-simple-icons": "^13.8.0",
|
"@icons-pack/react-simple-icons": "^13.8.0",
|
||||||
"@nestjs/common": "^11.1.10",
|
"@nestjs/common": "^11.1.10",
|
||||||
"@nestjs/core": "^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/platform-fastify": "^11.1.10",
|
||||||
|
"@nestjs/websockets": "^11.1.11",
|
||||||
"@orpc/client": "^1.10.4",
|
"@orpc/client": "^1.10.4",
|
||||||
"@orpc/server": "^1.11.3",
|
"@orpc/server": "^1.11.3",
|
||||||
"@radix-ui/react-avatar": "^1.1.11",
|
"@radix-ui/react-avatar": "^1.1.11",
|
||||||
|
|||||||
@@ -13,8 +13,12 @@ export const startGateway = async (port: number): Promise<boolean> => {
|
|||||||
try {
|
try {
|
||||||
// Stop if already running
|
// Stop if already running
|
||||||
await stopNestServer();
|
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) {
|
} catch (e) {
|
||||||
console.error('Failed to start gateway:', e);
|
console.error('Failed to start gateway:', e);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'reflect-metadata';
|
||||||
import { NestFactory } from '@nestjs/core';
|
import { NestFactory } from '@nestjs/core';
|
||||||
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
|
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from './app.module';
|
||||||
|
|||||||
@@ -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 { FastifyReply } from 'fastify';
|
||||||
import { ProxyService } from './proxy.service';
|
import { ProxyService } from './proxy.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
@@ -8,7 +8,7 @@ import { ProxyGuard } from './proxy.guard';
|
|||||||
@Controller('v1')
|
@Controller('v1')
|
||||||
@UseGuards(ProxyGuard)
|
@UseGuards(ProxyGuard)
|
||||||
export class ProxyController {
|
export class ProxyController {
|
||||||
constructor(private readonly proxyService: ProxyService) {}
|
constructor(@Inject(ProxyService) private readonly proxyService: ProxyService) {}
|
||||||
|
|
||||||
@Get('models')
|
@Get('models')
|
||||||
getModels() {
|
getModels() {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"lib": ["dom", "ESNext"],
|
"lib": ["dom", "ESNext"],
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
|||||||
Reference in new issue
Block a user