File size: 702 Bytes
b2806e8
 
 
 
 
ece880f
a7f07e8
b2806e8
a7f07e8
b2806e8
 
ece880f
b2806e8
ece880f
a7f07e8
 
 
 
 
 
 
ece880f
 
b2806e8
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  
  // Configure CORS
  app.enableCors({
    origin: true,
    credentials: true,
  });
  
  app.setGlobalPrefix('api');
  
  // Serve root health-check (HF Spaces hits GET /)
  const httpAdapter = app.getHttpAdapter();
  httpAdapter.get('/', (req: any, res: any) => {
    res.json({ status: 'ok', service: 'WagerKit API', docs: '/api/markets' });
  });
  
  const port = process.env.PORT || process.env.BACKEND_PORT || 3001;
  await app.listen(port);
  console.log(`WagerKit API running on http://localhost:${port}`);
}
bootstrap();