diff --git a/src/index.ts b/src/index.ts index 00e0e74..1c1b836 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,10 +15,10 @@ app.use( methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"], allowedHeaders: ["Content-Type", "Authorization"], credentials: true, - }) + maxAge: 3600, + }), ); - app.use(express.json()); app.use("/api/auth", authRoutes); diff --git a/src/prismaClient.ts b/src/prismaClient.ts index 64d06b2..1efadef 100644 --- a/src/prismaClient.ts +++ b/src/prismaClient.ts @@ -2,7 +2,12 @@ import { PrismaClient } from "@prisma/client"; import { PrismaPg } from "@prisma/adapter-pg"; import pg from "pg"; -const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL }); +const pool = new pg.Pool({ + connectionString: process.env.DATABASE_URL, + max: 10, + idleTimeoutMillis: 30000, + connectionTimeoutMillis: 5000, +}); const adapter = new PrismaPg(pool, { schema: "Athena" }); const prisma = new PrismaClient({ adapter });