mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-07 15:03:53 +05:00
feat/api-prox: bump version to 1001.0.0
This commit is contained in:
parent
a24371cf24
commit
9fe2ba4aa7
3 changed files with 22 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
// Epoch Semantic Versioning - https://antfu.me/posts/epoch-semver
|
// Epoch Semantic Versioning - https://antfu.me/posts/epoch-semver
|
||||||
// {EPOCH * 1000 + MAJOR}.MINOR.PATCH
|
// {EPOCH * 1000 + MAJOR}.MINOR.PATCH
|
||||||
export const appVersion = "0000.0.0";
|
export const appVersion = "1001.0.0";
|
||||||
|
|
||||||
export const BASE_URLS = [
|
export const BASE_URLS = [
|
||||||
"https://api-s.anixsekai.com/",
|
"https://api-s.anixsekai.com/",
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
import { Hono } from "hono";
|
import { Hono } from "hono";
|
||||||
import { logger } from "hono/logger";
|
import { logger } from "hono/logger";
|
||||||
import { InfoLogger, RouteLogger } from "./utils/logger.js";
|
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 { ANIXART_HEADERS, appVersion, BASE_URLS } from "./config.js";
|
||||||
import { tryCatchAPI } from "./utils/tryCatch.js";
|
import { tryCatchAPI } from "./utils/tryCatch.js";
|
||||||
import { hookList, runHooks } from "./hooks/index.ts";
|
import { hookList, runHooks } from "./hooks/index.ts";
|
||||||
|
@ -52,14 +56,21 @@ app.get("/health", (c) => {
|
||||||
${asciiHTML()}
|
${asciiHTML()}
|
||||||
${separatorHTML()}
|
${separatorHTML()}
|
||||||
<p id="status">Status: OK</p>
|
<p id="status">Status: OK</p>
|
||||||
|
<p>Request Time: ${new Date().toLocaleString("ru-RU")}</p>
|
||||||
<p>Version: ${appVersion}</p>
|
<p>Version: ${appVersion}</p>
|
||||||
|
<p>Runner: ${getRunningEnvironment()}</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/health/json", (c) => {
|
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) => {
|
app.get("/favicon.ico", (c) => {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
// / ___ |/ / / / /> </ /_/ / / / /_ / ___ |/ ____// / / ____/ / / /_/ /> </ /_/ /
|
// / ___ |/ / / / /> </ /_/ / / / /_ / ___ |/ ____// / / ____/ / / /_/ /> </ /_/ /
|
||||||
// /_/ |_/_/ /_/_/_/|_|\__,_/_/ \__/ /_/ |_/_/ /___/ /_/ /_/ \____/_/|_|\__, /
|
// /_/ |_/_/ /_/_/_/|_|\__,_/_/ \__/ /_/ |_/_/ /___/ /_/ /_/ \____/_/|_|\__, /
|
||||||
// /____/
|
// /____/
|
||||||
|
import { getRuntimeKey } from 'hono/adapter';
|
||||||
export function asciiHTML() {
|
export function asciiHTML() {
|
||||||
const stringBuilder = [];
|
const stringBuilder = [];
|
||||||
stringBuilder.push(`<pre>`);
|
stringBuilder.push(`<pre>`);
|
||||||
|
@ -24,4 +24,11 @@ export function separatorHTML() {
|
||||||
stringBuilder.push("-".repeat(92))
|
stringBuilder.push("-".repeat(92))
|
||||||
stringBuilder.push(`</pre>`);
|
stringBuilder.push(`</pre>`);
|
||||||
return stringBuilder.join("\n");
|
return stringBuilder.join("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRunningEnvironment() {
|
||||||
|
const runtime = getRuntimeKey();
|
||||||
|
if (runtime == "workerd") return "CloudFlare Workers";
|
||||||
|
if (runtime == "node") return "Node.js";
|
||||||
|
return runtime;
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue