feat/api-prox: bump version to 1001.0.0

This commit is contained in:
Kentai Radiquum 2025-09-06 20:01:23 +05:00
parent a24371cf24
commit 9fe2ba4aa7
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
3 changed files with 22 additions and 4 deletions

View file

@ -1,6 +1,6 @@
// Epoch Semantic Versioning - https://antfu.me/posts/epoch-semver
// {EPOCH * 1000 + MAJOR}.MINOR.PATCH
export const appVersion = "0000.0.0";
export const appVersion = "1001.0.0";
export const BASE_URLS = [
"https://api-s.anixsekai.com/",

View file

@ -1,7 +1,11 @@
import { Hono } from "hono";
import { logger } from "hono/logger";
import { InfoLogger, RouteLogger } from "./utils/logger.js";
import { asciiHTML, separatorHTML } from "./utils/info.js";
import {
asciiHTML,
getRunningEnvironment,
separatorHTML,
} from "./utils/info.js";
import { ANIXART_HEADERS, appVersion, BASE_URLS } from "./config.js";
import { tryCatchAPI } from "./utils/tryCatch.js";
import { hookList, runHooks } from "./hooks/index.ts";
@ -52,14 +56,21 @@ app.get("/health", (c) => {
${asciiHTML()}
${separatorHTML()}
<p id="status">Status: OK</p>
<p>Request Time: ${new Date().toLocaleString("ru-RU")}</p>
<p>Version: ${appVersion}</p>
<p>Runner: ${getRunningEnvironment()}</p>
</body>
</html>
`);
});
app.get("/health/json", (c) => {
return c.json({ status: "OK", version: appVersion });
return c.json({
status: "OK",
time: new Date().getTime(),
version: appVersion,
runner: getRunningEnvironment(),
});
});
app.get("/favicon.ico", (c) => {

View file

@ -4,7 +4,7 @@
// / ___ |/ / / / /> </ /_/ / / / /_ / ___ |/ ____// / / ____/ / / /_/ /> </ /_/ /
// /_/ |_/_/ /_/_/_/|_|\__,_/_/ \__/ /_/ |_/_/ /___/ /_/ /_/ \____/_/|_|\__, /
// /____/
import { getRuntimeKey } from 'hono/adapter';
export function asciiHTML() {
const stringBuilder = [];
stringBuilder.push(`<pre>`);
@ -25,3 +25,10 @@ export function separatorHTML() {
stringBuilder.push(`</pre>`);
return stringBuilder.join("\n");
}
export function getRunningEnvironment() {
const runtime = getRuntimeKey();
if (runtime == "workerd") return "CloudFlare Workers";
if (runtime == "node") return "Node.js";
return runtime;
}