Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Commit ede35ba

Browse files
committed
Feat: Add utils route(s)
1 parent d54b56b commit ede35ba

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

src/routes/utils.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Elysia, t } from "elysia";
2+
import {
3+
version,
4+
authorEmail,
5+
authorName,
6+
authorWebsite,
7+
contributors,
8+
dependencies,
9+
description,
10+
devDependencies,
11+
license,
12+
} from "~/core/utils/package-json";
13+
import { responseHandler } from "~/core/utils/respone-handler";
14+
15+
export const utilRoutes = new Elysia({ prefix: "/utils" }).get(
16+
"/info",
17+
async ({ set }) => {
18+
try {
19+
set.status = 200;
20+
return {
21+
version,
22+
authorEmail,
23+
authorName,
24+
authorWebsite,
25+
contributors,
26+
dependencies,
27+
description,
28+
devDependencies,
29+
license,
30+
};
31+
} catch (error: any) {
32+
return responseHandler.error(
33+
set,
34+
error.message || error,
35+
"Error getting DockStatAPI information",
36+
);
37+
}
38+
},
39+
{
40+
detail: {
41+
tags: ["Utils"],
42+
description: "Shows general information about DockStatAPI",
43+
},
44+
},
45+
);

0 commit comments

Comments
 (0)