From 9fe2ba4aa76c7b0f7187784b6124179cc6d9592e Mon Sep 17 00:00:00 2001 From: Radiquum Date: Sat, 6 Sep 2025 20:01:23 +0500 Subject: [PATCH] feat/api-prox: bump version to 1001.0.0 --- api-prox/src/config.ts | 2 +- api-prox/src/index.ts | 15 +++++++++++++-- api-prox/src/utils/info.ts | 9 ++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/api-prox/src/config.ts b/api-prox/src/config.ts index bdc8c99..0faa4aa 100644 --- a/api-prox/src/config.ts +++ b/api-prox/src/config.ts @@ -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/", diff --git a/api-prox/src/index.ts b/api-prox/src/index.ts index c77f617..164ac2d 100644 --- a/api-prox/src/index.ts +++ b/api-prox/src/index.ts @@ -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()}

Status: OK

+

Request Time: ${new Date().toLocaleString("ru-RU")}

Version: ${appVersion}

+

Runner: ${getRunningEnvironment()}

`); }); 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) => { diff --git a/api-prox/src/utils/info.ts b/api-prox/src/utils/info.ts index 603108a..e48ed50 100644 --- a/api-prox/src/utils/info.ts +++ b/api-prox/src/utils/info.ts @@ -4,7 +4,7 @@ // / ___ |/ / / / /> `); @@ -24,4 +24,11 @@ export function separatorHTML() { stringBuilder.push("-".repeat(92)) stringBuilder.push(``); return stringBuilder.join("\n"); +} + +export function getRunningEnvironment() { + const runtime = getRuntimeKey(); + if (runtime == "workerd") return "CloudFlare Workers"; + if (runtime == "node") return "Node.js"; + return runtime; } \ No newline at end of file