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("portfolio")
|
||||||
const db = client.db("SloppyFuckers")
|
|
||||||
return await db.collection("players").find({}).toArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getEvents() {
|
export async function getProjects() {
|
||||||
const db = client.db("SloppyFuckers")
|
return await db.collection("projects").find({}).toArray()
|
||||||
return await db.collection("events").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 (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<div className="mx-auto grid max-w-screen-xl px-4 py-8 text-center lg:py-16">
|
<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">
|
<h1 className="mb-4 max-w-2xl text-4xl font-extrabold leading-none tracking-tight md:text-5xl xl:text-6xl">
|
||||||
IsaCon
|
IsaCon
|
||||||
</h1>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,6 @@ export default function Navbar() {
|
||||||
>
|
>
|
||||||
Projects
|
Projects
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
|
||||||
href="/calendar"
|
|
||||||
className="rounded-md px-3 py-2 text-sm font-medium text-primary-50 hover:bg-primary-700 hover:text-white"
|
|
||||||
>
|
|
||||||
Calendar
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue