917 B
917 B
packages/api-server
Scope
- This package is the HTTP transport layer over
@marketplace-scrapers/core. - Route files in
src/routes/*.tsshould parse inputs, call core, and map responses/errors.
Keep Thin
- Do not move scraping, parsing, selector, or cookie-loading logic into routes.
- If route code starts branching on marketplace behavior, push that behavior back into
packages/core.
Route Conventions
- Register new routes in
src/index.ts. - Follow existing input precedence where present:
queryheader first, thenqsearch param. - Preserve existing response shape style:
Response.json(...),400for bad input/errors,404for empty result sets,200for success. - Keep query parameter names aligned with the MCP server because MCP builds URLs against these endpoints.
Verify
bun test packages/api-server/testbun run --cwd packages/api-server buildbun run ci