use db
This commit is contained in:
@@ -1,10 +1,18 @@
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { db } from "~/server/db";
|
||||||
|
|
||||||
export default function HomePage() {
|
export default async function HomePage() {
|
||||||
|
const posts = await db.query.posts.findMany()
|
||||||
return (
|
return (
|
||||||
<main className="flex min-h-screen flex-col items-center justify-center bg-black text-white">
|
<main className="flex min-h-screen flex-col items-center justify-center bg-black text-white">
|
||||||
<div>
|
<div>
|
||||||
Hello World
|
{posts.map((post) => {
|
||||||
|
return (
|
||||||
|
<div key={post.id}>
|
||||||
|
{post.name}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user