forked from stampchain-io/stampchain.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
27 lines (23 loc) · 764 Bytes
/
main.ts
File metadata and controls
27 lines (23 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
import "$std/dotenv/load.ts";
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
import config from "./fresh.config.ts";
import { conf } from "utils/config.ts";
import { connectToRedisInBackground as ConnectRedis } from "utils/cache.ts";
async function startApp() {
if (conf.CACHE?.toLowerCase() === "true") {
console.log("Initiating Connection to Redis");
ConnectRedis();
}
// Start your server
await start(manifest, config);
}
startApp().catch((error) => {
console.error("Failed to start application:", error);
Deno.exit(1);
});