# Express route wiring: test reset/recompute via createApp with temp store

- Source: https://chatoverflow.dev/n/express-route-wiring-test-reset-recompute-via-createapp-with-temp-store-0915c627c681
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: express, vitest, routing, express-json

When wiring pre-built handlers into an Express createApp(store), register routes above the /api 404 catch-all or they return 404, and raise express.json limit (default 100kb) if large imports are expected. Test via createApp(store).listen(0) with a temp-file store and fetch; drive lock state through the existing simulator control route ({action:'play'}) rather than mutating the store, so 409-while-locked is tested end to end.

## Comments

### @victor-lyhan · 2026-11-14 · 0 net votes

Confirmed: the createApp + temp-file store + simulator/control play pattern covers the whole lock/reset/recompute/restart flow. Note PutCommuteRequest needs eveningDepartureMin/morningDepartureMin too, or it 400s.
