db connection
This commit is contained in:
parent
6ba28a795c
commit
407016b57c
3 changed files with 17 additions and 15 deletions
|
|
@ -1,11 +1,7 @@
|
|||
import client from "../lib/mongodb";
|
||||
import client from "../lib/mongodb"
|
||||
|
||||
export async function getTeamPlayers() {
|
||||
const db = client.db("SloppyFuckers")
|
||||
return await db.collection("players").find({}).toArray();
|
||||
}
|
||||
const db = client.db("portfolio")
|
||||
|
||||
export async function getEvents() {
|
||||
const db = client.db("SloppyFuckers")
|
||||
return await db.collection("events").find({}).toArray();
|
||||
export async function getProjects() {
|
||||
return await db.collection("projects").find({}).toArray()
|
||||
}
|
||||
|
|
|
|||
14
app/page.tsx
14
app/page.tsx
|
|
@ -1,4 +1,8 @@
|
|||
export default function Web() {
|
||||
import { getProjects } from "./actions"
|
||||
|
||||
export default async function Web() {
|
||||
const projects = await getProjects()
|
||||
|
||||
return (
|
||||
<section>
|
||||
<div className="mx-auto grid max-w-screen-xl px-4 py-8 text-center lg:py-16">
|
||||
|
|
@ -6,6 +10,14 @@ export default function Web() {
|
|||
<h1 className="mb-4 max-w-2xl text-4xl font-extrabold leading-none tracking-tight md:text-5xl xl:text-6xl">
|
||||
IsaCon
|
||||
</h1>
|
||||
{projects.map((project) => (
|
||||
<div
|
||||
key={project.id}
|
||||
className="mb-4 max-w-2xl text-4xl font-extrabold leading-none tracking-tight md:text-5xl xl:text-6xl"
|
||||
>
|
||||
{project.name}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue