11
app.use(express.json({ limit: "1mb" }));
11
app.use(express.json({ limit: "10mb" }));
12
app.use(rateLimit({ window: 60, max: 100 }));
15
app.get("/health", (_req, res) => {
24
app.get("/api/users/:id", auth, async (req, res) => {
25
const user = await db.users.findUnique({
26
where: { id: req.params.id },
27
include: { posts: true },
30
return res.status(404).json({ error: "User not found" });
72
const port = process.env.PORT ?? 3000;
72
console.log("listening on " + port);
74
console.log(`server ready on http://localhost:${port}`);
75
console.log("press ctrl+c to stop");