prod db #1
This commit is contained in:
parent
04af299887
commit
6aed03b2b7
4 changed files with 4 additions and 11 deletions
|
@ -7,6 +7,7 @@ export async function GET(req: NextRequest) {
|
|||
const client = await clientPromise;
|
||||
const db = client.db("downloadsDatabase");
|
||||
const downloads = await db.collection("downloads").find().toArray();
|
||||
// console.log("Downloads fetched:", downloads);
|
||||
return NextResponse.json(downloads, { status: 200 });
|
||||
} catch (error) {
|
||||
console.log(`Error Messge ${error}`);
|
||||
|
|
|
@ -9,7 +9,7 @@ const Footer = () => {
|
|||
<>
|
||||
<footer className="flex flex-col w-full transition-all bg-zinc-100 text-black dark:bg-[#0308033b] border-t dark:text-white">
|
||||
<div className="px-6 md:px-16 lg:px-32 py-10 w-full mx-auto max-w-screen-2xl">
|
||||
<div className="flex flex-col lg:flex-row justify-between max-lg:items-start max-md:items-center items-center mb-14 ">
|
||||
<div className="flex flex-col lg:flex-row justify-between max-lg:items-start max-md:items-center items-center mb-6 ">
|
||||
<div className="flex items-center mb-6 lg:mb-0">
|
||||
<Image
|
||||
src="/logo.svg"
|
||||
|
|
|
@ -124,10 +124,12 @@ export const FOOTERLINKS = {
|
|||
{ href: "/contact", label: "Contact" },
|
||||
{ href: "/blog", label: "Blog" },
|
||||
{ href: "/forum", label: "Forum" },
|
||||
{ href: "/changelogs", label: "Change Logs" },
|
||||
],
|
||||
plans: [
|
||||
{ href: "/docs", label: "Docs" },
|
||||
{ href: "/downloads", label: "Downloads" },
|
||||
{ href: "/mods", label: "Svrjs Mods" },
|
||||
{ href: "/tos", label: "Terms of Serivce" },
|
||||
{ href: "/privacy-policy", label: "Privacy Policy" },
|
||||
],
|
||||
|
|
10
lib/db.ts
10
lib/db.ts
|
@ -19,17 +19,7 @@ declare global {
|
|||
var _mongoClientPromise: Promise<MongoClient> | undefined;
|
||||
}
|
||||
|
||||
// if (process.env.NODE_ENV === "development") {
|
||||
// // In development mode, use a global variable to ensure the client is not recreated
|
||||
// if (!global._mongoClientPromise) {
|
||||
// client = new MongoClient(uri, options);
|
||||
// global._mongoClientPromise = client.connect();
|
||||
// }
|
||||
// clientPromise = global._mongoClientPromise;
|
||||
// } else {
|
||||
// In production mode, create a new client for each request
|
||||
client = new MongoClient(uri, options);
|
||||
clientPromise = client.connect();
|
||||
// }
|
||||
|
||||
export default clientPromise;
|
||||
|
|
Loading…
Reference in a new issue