✳ Update(src/api/routes.ts)
31 - app.get('/users', handler);
31 + app.get('/users', auth, handler);
32 + app.get('/users/:id', auth, getUser);
● Read 4 files
● Bash(cd ~/app && npm test)
> app@1.4.2 test
> jest --coverage
PASS src/api/routes.test.ts
PASS src/auth/middleware.test.ts
PASS src/db/queries.test.ts
✳ Update(src/db/pool.ts)
12 - const pool = createPool(5);
12 + const pool = createPool(20);
13 + pool.on('error', handleErr);
● Read 2 files
I've added auth middleware to all
user routes and increased the DB
connection pool with error handling.
- Auth guard on GET /users
- New GET /users/:id endpoint
- Pool size 5 -> 20 + error cb
>