Return a standard error shape
server/src/index.ts
Handle not found
server/src/index.ts
Catch unexpected errors
server/src/index.ts
Register global handlers
server/src/index.ts
Standard status codes
The platform automatically returns
401 for unauthenticated requests to /api/* routes before your handler runs. You usually only need to handle 403 Forbidden yourself.See also
Build a REST API
A complete example with validation, auth, uploads, and error handling.
View logs
Read runtime logs and exceptions from your deployed project.