style: formatting changes

This commit is contained in:
Ritesh Ghosh
2025-04-15 00:11:33 +05:30
parent f5cd3415d8
commit f7af9c890a
2 changed files with 78 additions and 68 deletions
+6 -1
View File
@@ -41,7 +41,12 @@ export class AniwatchAPICache {
if (!data) { if (!data) {
data = await setCB(); data = await setCB();
await this._client?.set(key, JSON.stringify(data), "EX", expirySeconds); await this._client?.set(
key,
JSON.stringify(data),
"EX",
expirySeconds
);
} }
return data; return data;
} }
+10 -5
View File
@@ -50,9 +50,9 @@ app.get("/v", async (c) =>
app.use(cacheConfigSetter(BASE_PATH.length)); app.use(cacheConfigSetter(BASE_PATH.length));
app.basePath(BASE_PATH).route("/hianime", hianimeRouter); app.basePath(BASE_PATH).route("/hianime", hianimeRouter);
app app.basePath(BASE_PATH).get("/anicrush", (c) =>
.basePath(BASE_PATH) c.text("Anicrush could be implemented in future.")
.get("/anicrush", (c) => c.text("Anicrush could be implemented in future.")); );
app.notFound(notFoundHandler); app.notFound(notFoundHandler);
app.onError(errorHandler); app.onError(errorHandler);
@@ -64,7 +64,9 @@ if (!Boolean(process.env?.ANIWATCH_API_VERCEL_DEPLOYMENT)) {
fetch: app.fetch, fetch: app.fetch,
}).addListener("listening", () => }).addListener("listening", () =>
console.info( console.info(
"\x1b[1;36m" + `aniwatch-api at http://localhost:${PORT}` + "\x1b[0m" "\x1b[1;36m" +
`aniwatch-api at http://localhost:${PORT}` +
"\x1b[0m"
) )
); );
@@ -74,7 +76,10 @@ if (!Boolean(process.env?.ANIWATCH_API_VERCEL_DEPLOYMENT)) {
// don't sleep // don't sleep
setInterval(() => { setInterval(() => {
console.log("aniwatch-api HEALTH_CHECK at", new Date().toISOString()); console.log(
"aniwatch-api HEALTH_CHECK at",
new Date().toISOString()
);
https https
.get(`https://${ANIWATCH_API_HOSTNAME}/health`) .get(`https://${ANIWATCH_API_HOSTNAME}/health`)
.on("error", (err) => { .on("error", (err) => {