Skip to content

Commit 16b194e

Browse files
committed
Add Vercel configuration
1 parent 6aa535e commit 16b194e

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ yarn-error.log*
4141
next-env.d.ts
4242

4343
dist/
44-
release/
44+
release/
45+
public/

src/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Hono } from "hono";
2+
import api from "./api/api";
3+
4+
const app = new Hono();
5+
6+
// API routes
7+
app.route("/", api);
8+
9+
// Static files and SPA fallback handled by Vercel via public/ directory and rewrites
10+
// This file is the API entry point for Vercel's backend detection
11+
12+
export default app;

vercel.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://openapi.vercel.sh/vercel.json",
3+
"installCommand": "bun install",
4+
"buildCommand": "bun run build:browser && mkdir -p public && cp -r dist/browser/* public/",
5+
"outputDirectory": "public",
6+
"rewrites": [
7+
{ "source": "/api/:path*", "destination": "/api/:path*" },
8+
{ "source": "/((?!api/).*)", "destination": "/index.html" }
9+
]
10+
}

0 commit comments

Comments
 (0)