Skip to content
Source
Sign inSign up
samwillis/jerry
Open History to see the last commit

index.ts

25 lines761 Bytes

1import pg from "pg";
2import { attachDatabasePool } from "@neon/functions";
3import { config } from "./config.js";
4import { authentication } from "./auth.js";
5import { postgres } from "./database.js";
6import { createApp } from "./app.js";
7declare const __JOL_ASSETS__: Record<string, { base64: string; type: string }>;
8const settings = config();
9const pool = new pg.Pool({
10 connectionString: process.env.DATABASE_URL,
11 max: 3,
12});
13attachDatabasePool(pool);
14const assets = Object.fromEntries(
15 Object.entries(__JOL_ASSETS__).map(([key, value]) => [
16 key,
17 { body: Buffer.from(value.base64, "base64"), type: value.type },
18 ]),
19);
20export default createApp({
21 db: postgres(pool),
22 config: settings,
23 authenticate: authentication(settings),
24 assets,
25});