forked from creations/badgeAPI
add index route info, make it fetch per hour instead of every user, add health route, update to latest biome config aswell as logger
This commit is contained in:
parent
8cfa75ec57
commit
75d3dab85e
21 changed files with 943 additions and 364 deletions
22
src/index.ts
22
src/index.ts
|
@ -1,8 +1,25 @@
|
|||
import { echo } from "@atums/echo";
|
||||
|
||||
import { serverHandler } from "@/server";
|
||||
import { verifyRequiredVariables } from "@config";
|
||||
import { badgeCacheManager } from "@lib/badgeCache";
|
||||
import { serverHandler } from "@server";
|
||||
|
||||
async function main(): Promise<void> {
|
||||
verifyRequiredVariables();
|
||||
|
||||
await badgeCacheManager.initialize();
|
||||
|
||||
process.on("SIGINT", async () => {
|
||||
echo.debug("Received SIGINT, shutting down gracefully...");
|
||||
await badgeCacheManager.shutdown();
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
process.on("SIGTERM", async () => {
|
||||
echo.debug("Received SIGTERM, shutting down gracefully...");
|
||||
await badgeCacheManager.shutdown();
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
serverHandler.initialize();
|
||||
}
|
||||
|
||||
|
@ -15,5 +32,6 @@ main().catch((error: Error) => {
|
|||
});
|
||||
|
||||
if (process.env.IN_PTERODACTYL === "true") {
|
||||
// biome-ignore lint/suspicious/noConsole: Needed for Pterodactyl to actually know the server started
|
||||
console.log("Server Started");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue