refactor/api-prox: config.json -> config.ts

This commit is contained in:
Kentai Radiquum 2025-09-06 00:19:16 +05:00
parent 83fe8e80e3
commit 002b5a446c
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
6 changed files with 23 additions and 9 deletions

View file

@ -1 +0,0 @@
{"appVersion": "0.0.1"}

1
api-prox/src/config.ts Normal file
View file

@ -0,0 +1 @@
export const appVersion = "0.0.0";

View file

@ -1,7 +1,7 @@
import { Hono } from "hono";
import { trimTrailingSlash } from 'hono/trailing-slash'
import { asciiHTML, separatorHTML } from "./utils/info.js";
import config from "./config.json" with { type: "json" };
import { appVersion } from "./config.js";
const app = new Hono({ strict: true });
app.use(trimTrailingSlash())
@ -49,14 +49,14 @@ app.get("/health", (c) => {
${asciiHTML()}
${separatorHTML()}
<p id="status">Status: OK</p>
<p>Version: ${config.appVersion}</p>
<p>Version: ${appVersion}</p>
</body>
</html>
`);
});
app.get("/health/json", (c) => {
return c.json({"status": "OK", "version": config.appVersion});
return c.json({"status": "OK", "version": appVersion});
});
export default app;