- Add a centralized Fastify error handler with server-side error logging
- Preserve valid 4xx status codes while normalizing other errors to HTTP 500
- Return generic error messages without exposing sensitive internal details
- Add a test endpoint and regression test for unexpected errors
- Verify 500-character messages are accepted
- Verify messages exceeding 500 characters are rejected with HTTP 400
- Extract the Zod validation schema to module scope for reuse
- Test successful echo responses for valid messages
- Verify empty messages are rejected with HTTP 400
- Validate request bodies using a Zod schema with a 1–500 character limit
- Return a consistent error response for invalid request bodies
- Extract route and server configuration into an exported buildApp function
- Guard server startup so importing the module does not automatically listen on port 3000
- Preserve health and readiness endpoints and loopback-only binding
- Normalize string literals to double quotes