fix AGENTS.md stack ref, add CORS plugin, add .env.example, remove dead index.ts

This commit is contained in:
kami
2026-07-14 01:36:25 +04:00
parent 737bf19fd1
commit 42474c65fd
4 changed files with 43 additions and 1 deletions
+5
View File
@@ -1,4 +1,5 @@
import Fastify from 'fastify';
import cors from '@fastify/cors';
import { Client as PgClient } from 'pg';
import { createClient as createRedisClient } from 'redis';
import { DbService } from './services/db.service.js';
@@ -28,6 +29,10 @@ export interface AppConfig {
export async function buildApp(config: AppConfig) {
const fastify = Fastify({ logger: true });
await fastify.register(cors, {
origin: process.env.CORS_ORIGIN?.split(',') || ['http://localhost:5173', 'http://localhost:5174'],
});
const pgClient = new PgClient({
connectionString: process.env.DATABASE_URL,
});
-1
View File
@@ -1 +0,0 @@
console.log('Backend starting...');