From 2f433f009cebc4558160e87bc067145c76e06e28 Mon Sep 17 00:00:00 2001 From: zulfikarrosadi Date: Sun, 17 Nov 2024 08:49:21 +0700 Subject: [PATCH] fix(deployment): use api folder so vercel will work i still dont understand about this, but it seems vercel will look into api folder as default to build the functions, but if you want to put your routes directly in src/index.ts, we dont need api folder --- api/index.ts | 3 +++ vercel.json | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 api/index.ts diff --git a/api/index.ts b/api/index.ts new file mode 100644 index 0000000..d71dd4d --- /dev/null +++ b/api/index.ts @@ -0,0 +1,3 @@ +import app from '../src/index' + +export default app diff --git a/vercel.json b/vercel.json index 7beddb0..e7078a3 100644 --- a/vercel.json +++ b/vercel.json @@ -2,14 +2,14 @@ "version": 2, "builds": [ { - "src": "src/index.ts", + "src": "api/index.ts", "use": "@vercel/node" } ], "rewrites": [ { "source": "/(.*)", - "destination": "/src/index.ts" + "destination": "/api" } ] }