Skip to content

Commit c0e0c2d

Browse files
committed
chore(apps/api): add vercel config
1 parent 03452fc commit c0e0c2d

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

apps/api/src/app/app.controller.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Controller, Get } from '@nestjs/common'
2+
3+
@Controller()
4+
export class AppController {
5+
@Get()
6+
getHello(): string {
7+
return 'Hello World!'
8+
}
9+
}

apps/api/src/app/app.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Module } from '@nestjs/common'
22
import { TRPCModule } from 'nestjs-trpc'
33
import { ConfigModule } from '@nestjs/config'
44

5+
import { AppController } from './app.controller'
6+
57
import { EnvModule, envSchema } from '~/config/env'
68
import { PrismaModule } from '~/config/prisma'
79
import { UsersModule } from '~/users'
@@ -21,5 +23,6 @@ import { ThoughtsModule } from '~/thoughts'
2123
UsersModule,
2224
ThoughtsModule,
2325
],
26+
controllers: [AppController],
2427
})
2528
export class AppModule {}

apps/api/vercel.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"version": 2,
3+
"builds": [
4+
{
5+
"src": "/apps/api/src/main.ts",
6+
"use": "@vercel/node",
7+
"config": { "includeFiles": ["dist/**"] }
8+
}
9+
],
10+
"routes": [
11+
{
12+
"src": "/(.*)",
13+
"dest": "/apps/api/src/main.ts",
14+
"methods": ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
15+
"headers": {
16+
"Access-Control-Allow-Credentials": "true",
17+
"Access-Control-Allow-Origin": "*"
18+
}
19+
}
20+
]
21+
}

0 commit comments

Comments
 (0)