Chapter 6 localhost:3000/seed not work
I started the deployed project on vercel.com. And there use /seed address. It works. It didnt work on my localhost
I started the deployed project on vercel.com. And there use /seed address. It works. It didnt work on my localhost
https://next-test-****.vercel**/seed.**app
I add /seed to vercel address - isn`t work((
Read this in july of this year, some ppl talked about this issue https://github.com/vercel/next-learn/issues/803 Maybe try to click in the ^ button at the end of the box with the placeholder 'Choose a table' But as said, in the link I provided, some ppl talked about the same issue, and most of them fixed it
in route.ts , from GET function remove the first return and restart the app, don't forget to go to the seed route
I started the deployed project on vercel.com. And there use /seed address. It works. It didnt work on my localhost
https://next-test-****.vercel**/seed.**app I add /seed to vercel address - isn`t work((
-
uncomment functions inside route.ts file
-
comment or remove the first return inside the GET function inside the route.ts file
export async function GET() {
// return Response.json({
// message:
// "Uncomment this file and remove this line. You can delete this file when you are finished.",
// });
try {
await client.sql`BEGIN`;
await seedUsers();
await seedCustomers();
await seedInvoices();
await seedRevenue();
await client.sql`COMMIT`;
return Response.json({ message: "Database seeded successfully" });
} catch (error) {
await client.sql`ROLLBACK`;
return Response.json({ error }, { status: 500 });
}
}
- deploy this version and then go to https://next-test-****.vercel**/seed.**app
great