Skip to content

validateApiRoutes

Open in ChatGPTOpen in Claude

validateApiRoutes(name, routes, basePath): void

Defined in: packages/core/src/lambda/define.ts:166

The route-array validator (D10). Shared so tests can exercise it directly.

Throws on:

  • empty routes[];
  • basePath not starting with ”/”;
  • a relative path (no leading ”/”) when basePath is unset;
  • an absolute path (leading ”/”) when basePath IS set (mixed forms);
  • a duplicate {method, effectivePath} within one handler.

string

readonly object[]

string

void

© 2026 Axis Tech. Powered by axis-tech.co.