Files
app.ts
What you'll learn
- Write every status in c.json() so each becomes a member of the route's response type
- Answer a missing resource with c.json({ error }, 404) instead of c.notFound(), which the client sees as unknown
- Use async/await in handlers rather than a .then() chain, and read a body or a refusal with parseResponse and DetailedError
Press Run tests to start the app. Its log appears here.Tests
- client.spec.tsrun to see its tests