Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import rateLimit from "express-rate-limit";
import authRouter from "./routes/auth";
import resourceRoutes from "./routes/resourceRoutes";
import flashcardsRoutes from "./routes/flashcards.routes";
import quizRoutes from "./routes/quiz.routes";
import aiRoutes from "./routes/ai.routes";
import { notFoundHandler, globalErrorHandler } from "./middleware/errorHandler";
import { auth as authMiddleware } from "./middleware/auth";
Expand Down Expand Up @@ -42,6 +43,7 @@ app.get("/health", (_req, res) => {
app.use("/api/auth", authRouter);
app.use("/api/resources", authMiddleware, resourceRoutes);
app.use("/api", authMiddleware, flashcardsRoutes);
app.use("/api", authMiddleware, quizRoutes);
app.use("/api", authMiddleware, aiRoutes);

app.use("*", notFoundHandler);
Expand Down
5 changes: 5 additions & 0 deletions backend/src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ export const LIMITS = {
TEXT_CONTENT_MAX_LENGTH: 100000, // 100KB for plain text content
MAX_TAGS: 10,
TAG_MAX_LENGTH: 30,

// Quiz limits
MAX_QUESTION_COUNT: 50,
MIN_QUESTION_COUNT: 3,
MIN_CHARS_PER_QUESTION: 50,
} as const;

export const validateEnv = () => {
Expand Down
Loading