27 lines
628 B
TypeScript
27 lines
628 B
TypeScript
import { serverHandler } from "@/server";
|
|
import { verifyRequiredVariables } from "@config/environment";
|
|
import { logger } from "@creations.works/logger";
|
|
import { cassandra } from "@lib/cassandra";
|
|
import { redis } from "bun";
|
|
|
|
async function main(): Promise<void> {
|
|
verifyRequiredVariables();
|
|
|
|
// Redis
|
|
try {
|
|
await redis.connect();
|
|
logger.info("Redis connection successful.");
|
|
} catch (error) {
|
|
logger.error(["Redis connection failed:", error as Error]);
|
|
process.exit(1);
|
|
}
|
|
|
|
await cassandra.connect();
|
|
|
|
serverHandler.initialize();
|
|
}
|
|
|
|
main().catch((error: Error) => {
|
|
logger.error(error);
|
|
process.exit(1);
|
|
});
|