Skip to main content
Glama
+server.js1.07 kB
import { json } from '@sveltejs/kit'; import { TestManager } from '$lib/server/TestManager.js'; const testManager = new TestManager(); /** @type {import('./$types').RequestHandler} */ export async function GET({ url }) { try { const status = url.searchParams.get('status'); const type = url.searchParams.get('type'); const sortBy = url.searchParams.get('sortBy'); const result = await testManager.listTestCases(status, type, sortBy); const testCases = result && result.testCases ? result.testCases : []; return json(testCases); } catch (error) { console.error('Error fetching test cases:', error); return json([]); } } /** @type {import('./$types').RequestHandler} */ export async function POST({ request }) { try { const testCaseData = await request.json(); const result = await testManager.createTestCase(testCaseData); return json(result, { status: 201 }); } catch (error) { console.error('Error creating test case:', error); return json({ error: 'Failed to create test case' }, { status: 500 }); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/foswmine/workflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server