@mastra/core
Version:
The core foundation of the Mastra framework, providing essential components and interfaces for building AI-powered applications.
18 lines (15 loc) • 411 B
JavaScript
// src/server/index.ts
function registerApiRoute(path, options) {
if (path.startsWith("/api/")) {
throw new Error(`Path must not start with "/api", it's reserved for internal API routes`);
}
return {
path,
method: options.method,
handler: options.handler,
openapi: options.openapi,
middleware: options.middleware
};
}
exports.registerApiRoute = registerApiRoute;
;