UNPKG

@mastra/core

Version:

The core foundation of the Mastra framework, providing essential components and interfaces for building AI-powered applications.

19 lines (16 loc) 453 B
'use strict'; // 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, createHandler: options.createHandler, openapi: options.openapi, middleware: options.middleware }; } exports.registerApiRoute = registerApiRoute;