Skip to content

Commit b76c300

Browse files
committed
refactor(api): update schema directory path to use path.resolve and add logging
1 parent 289e974 commit b76c300

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/api/list-schemas/route.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ export async function GET() {
2020
// }
2121

2222
try {
23-
// Adjust path for potentially different cwd() in Vercel - read directly from ./public relative to project root
24-
const schemasDirRelative = path.join("public", "api", "schemas"); // Path relative to project root
25-
const files = await fs.readdir(schemasDirRelative);
23+
// Adjust path for potentially different cwd() in Vercel - try path.resolve
24+
// const schemasDirRelative = path.join("public", "api", "schemas"); // Path relative to project root
25+
const schemasDir = path.resolve("./public/api/schemas");
26+
console.log(`Attempting to read schema directory: ${schemasDir}`); // Add logging
27+
const files = await fs.readdir(schemasDir);
2628

2729
// Filter to only include JSON files and exclude Zone.Identifier files
2830
const schemaFiles = files.filter(

0 commit comments

Comments
 (0)