use db
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
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 (
|
||||
<main className="flex min-h-screen flex-col items-center justify-center bg-black text-white">
|
||||
<div>
|
||||
Hello World
|
||||
{posts.map((post) => {
|
||||
return (
|
||||
<div key={post.id}>
|
||||
{post.name}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user