apitally
Version:
Simple API monitoring & analytics for REST APIs built with Express, Fastify, NestJS, AdonisJS, Hono, H3, Elysia, Hapi, and Koa.
36 lines (33 loc) • 862 B
text/typescript
import * as express from 'express';
declare function getRouterInfo(app: express.Express | express.Router | any): {
stack: any[] | null;
version: "v4" | "v5";
};
declare function parseExpressPathRegExp(expressPathRegExp: RegExp, keys: any[]): string;
declare function parseExpressPath(expressPath: string, params: {
[x: string]: string;
}): string;
declare function getEndpoints(app: any, basePath: any): {
method: string;
path: string;
}[];
type Route = {
methods: Object;
path: string | string[];
stack: any[];
};
type Endpoint = {
/**
* Path name
*/
path: string;
/**
* Methods handled
*/
methods: string[];
/**
* Mounted middlewares
*/
middlewares: string[];
};
export { type Endpoint, type Route, getEndpoints, getRouterInfo, parseExpressPath, parseExpressPathRegExp };