apitally
Version:
Simple API monitoring & analytics for REST APIs built with Express, Fastify, NestJS, AdonisJS, Hono, H3, Elysia, Hapi, and Koa.
54 lines • 1.25 kB
JavaScript
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
import { getPackageVersion } from "../common/packageVersions.js";
function getAppInfo(app, appVersion) {
const versions = [];
if (process.versions.node) {
versions.push([
"nodejs",
process.versions.node
]);
}
if (process.versions.bun) {
versions.push([
"bun",
process.versions.bun
]);
}
const elysiaVersion = getPackageVersion("elysia");
const apitallyVersion = getPackageVersion("../..");
if (elysiaVersion) {
versions.push([
"elysia",
elysiaVersion
]);
}
if (apitallyVersion) {
versions.push([
"apitally",
apitallyVersion
]);
}
if (appVersion) {
versions.push([
"app",
appVersion
]);
}
return {
paths: app.routes.map((route) => ({
method: route.method.toUpperCase(),
path: route.path
})).filter((route) => route.method && route.path && ![
"HEAD",
"OPTIONS"
].includes(route.method)),
versions: Object.fromEntries(versions),
client: "js:elysia"
};
}
__name(getAppInfo, "getAppInfo");
export {
getAppInfo
};
//# sourceMappingURL=utils.js.map