From 74c721d0da852664bbbeb19f5db5dc42feac4850 Mon Sep 17 00:00:00 2001 From: CodingForEntrepreneurs Date: Sat, 27 Jan 2024 12:26:41 -0700 Subject: [PATCH] Prepare for vercel --- api/index.js | 3 +++ public/.gitkeep | 0 public/index.html | 1 + src/index.js | 1 + vercel.json | 8 ++++++++ 5 files changed, 13 insertions(+) create mode 100644 api/index.js create mode 100644 public/.gitkeep create mode 100644 public/index.html create mode 100644 vercel.json diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..0610541 --- /dev/null +++ b/api/index.js @@ -0,0 +1,3 @@ +import { app } from '../src/index' + +export default app \ No newline at end of file diff --git a/public/.gitkeep b/public/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..9a1eb8d --- /dev/null +++ b/public/index.html @@ -0,0 +1 @@ +

Hello World

\ No newline at end of file diff --git a/src/index.js b/src/index.js index a03efb8..105aefb 100644 --- a/src/index.js +++ b/src/index.js @@ -67,4 +67,5 @@ app.use((req, res, next) => { // console.log("running at http://localhost:3000") // }) +module.exports.app = app module.exports.handler = serverless(app); diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..db68ad1 --- /dev/null +++ b/vercel.json @@ -0,0 +1,8 @@ +{ + "rewrites": [ + { + "source": "/api(.*)", + "destination": "/api" + } + ] +} \ No newline at end of file