Skip to content

Commit e5043dd

Browse files
committed
fix: Correct path for reading schemas in get-schema API route
1 parent 9f3708c commit e5043dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/api/get-schema/[name]/route.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ export async function GET(request: Request, context: any) {
5151
}
5252

5353
try {
54-
const schemasDir = path.resolve("./public/api/schemas");
54+
// In Vercel serverless functions, files included via outputFileTracingIncludes
55+
// are typically relative to process.cwd(). Our config includes './schemas/v1/**/*'.
56+
const schemasDir = path.join(process.cwd(), "schemas", "v1");
57+
5558
const filePath = safeJoin(schemasDir, `${safeSchemaName}.json`);
5659

5760
if (!filePath) {

0 commit comments

Comments
 (0)