mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-09 16:03:54 +05:00
refactor/api-prox: config.json -> config.ts
This commit is contained in:
parent
83fe8e80e3
commit
002b5a446c
6 changed files with 23 additions and 9 deletions
|
@ -1 +0,0 @@
|
|||
{"appVersion": "0.0.1"}
|
1
api-prox/src/config.ts
Normal file
1
api-prox/src/config.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export const appVersion = "0.0.0";
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue