optimization
This commit is contained in:
+2
-2
@@ -15,10 +15,10 @@ app.use(
|
|||||||
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
||||||
allowedHeaders: ["Content-Type", "Authorization"],
|
allowedHeaders: ["Content-Type", "Authorization"],
|
||||||
credentials: true,
|
credentials: true,
|
||||||
})
|
maxAge: 3600,
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
app.use("/api/auth", authRoutes);
|
app.use("/api/auth", authRoutes);
|
||||||
|
|||||||
+6
-1
@@ -2,7 +2,12 @@ import { PrismaClient } from "@prisma/client";
|
|||||||
import { PrismaPg } from "@prisma/adapter-pg";
|
import { PrismaPg } from "@prisma/adapter-pg";
|
||||||
import pg from "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 adapter = new PrismaPg(pool, { schema: "Athena" });
|
||||||
|
|
||||||
const prisma = new PrismaClient({ adapter });
|
const prisma = new PrismaClient({ adapter });
|
||||||
|
|||||||
Reference in New Issue
Block a user