Production error handling for Express APIs — error middleware, async wrappers,
89
86%
Does it follow best practices?
Impact
97%
2.02xAverage score across 4 eval scenarios
Passed
No known issues
Build a REST API for a small team productivity tool using Express and TypeScript.
Data model:
{ id, title, description, status, assigneeEmail, createdAt }"todo", "in_progress", "done"Endpoints:
GET /api/tasks -- list all tasks, optionally filter by ?status=todo query paramGET /api/tasks/:id -- get a single taskPOST /api/tasks -- create a task (title required, status defaults to "todo")PATCH /api/tasks/:id -- update task fields (validate status enum if provided)DELETE /api/tasks/:id -- delete a taskBusiness rules:
@ symbolUse in-memory storage. Include package.json with dependencies.
Produce:
src/server.ts -- server entry pointsrc/app.ts -- Express application setupsrc/routes/tasks.ts -- route handlerspackage.json -- with dependencies listedYou may create additional files for a well-organized codebase.