Response Classes
Use HttpResponse, DataResponse, and MessageResponse for consistent API success responses.
Explore Response Classes Standardize success responses with built-in classes.
LightTs includes built-in response and error handling classes as part of every project initialized with lts init. These core tools, built with native Node.js and Express, standardize API responses and errors, keeping your code clean and aligned with LightTs’s simplicity, like other utilities such as CORS and logging.
These classes are included in src/core/ when you create a LightTs project, using kebab-case for file names:
Response Classes
Use HttpResponse, DataResponse, and MessageResponse for consistent API success responses.
Error Classes
Use HttpError and specific error classes like ConflictError for robust error handling.