File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,18 @@ interface SchemaObject {
1111}
1212
1313export async function GET ( ) {
14- // This route should only be used in development
15- if ( process . env . NODE_ENV === "production" ) {
16- return NextResponse . json (
17- { error : "Endpoint not available in production. Use static index.json." } ,
18- { status : 404 } ,
19- ) ;
20- }
14+ // Remove the production check - allow the route to run in all environments
15+ // if (process.env.NODE_ENV === "production") {
16+ // return NextResponse.json(
17+ // { error: "Endpoint not available in production. Use static index.json." },
18+ // { status: 404 },
19+ // );
20+ // }
2121
2222 try {
23- const files = await fs . readdir ( SCHEMAS_DIR ) ;
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 ) ;
2426
2527 // Filter to only include JSON files and exclude Zone.Identifier files
2628 const schemaFiles = files . filter (
You can’t perform that action at this time.
0 commit comments