fix: move tools-export.json to public/ for Vercel compatibility

This commit is contained in:
Ajax Davis 2026-01-01 17:46:36 +10:00
parent 4fccc796f5
commit f6cf1aa7c5
2 changed files with 4 additions and 3 deletions

View file

@ -175715,7 +175715,7 @@
"description": "Create an active email channel named 'ServerAlerts' to receive high and critical severity alerts."
},
{
"inputJson": "{\"channelType\":\"slack\",\"destination\":\"https://example.com/webhook-placeholder",\"name\":\"OpsTeam\",\"enabled\":false}",
"inputJson": "{\"channelType\":\"slack\",\"destination\":\"https://example.com/webhook\",\"name\":\"OpsTeam\",\"enabled\":false}",
"description": "Create a disabled Slack webhook channel to be activated later for ops notifications."
}
],

View file

@ -57,7 +57,8 @@ function loadToolIdeas(): ToolIdeasData {
}
try {
const filePath = join(process.cwd(), 'data', 'tools-export.json');
// On Vercel, public files are in the project root under 'public'
const filePath = join(process.cwd(), 'public', 'tools-export.json');
const fileContent = readFileSync(filePath, 'utf-8');
cachedData = JSON.parse(fileContent) as ToolIdeasData;
return cachedData;
@ -76,7 +77,7 @@ export async function GET(request: NextRequest) {
const category = searchParams.get('category') || '';
const minQuality = Number.parseFloat(searchParams.get('minQuality') || '0');
const verb = searchParams.get('verb') || '';
const limit = Math.min(Number.parseInt(searchParams.get('limit') || '100'), 1000);
const limit = Math.min(Number.parseInt(searchParams.get('limit') || '100'), 10000);
const offset = Number.parseInt(searchParams.get('offset') || '0');
const data = loadToolIdeas();