A standard response builder.
This package includes different response builders based on the JSON response structure specified in JSON Data Errors Response (JDER). With the builders, various kinds of responses can be created easily instead of sending plain text responses.
To create a JSON response, use the following code:
import { createJsonResponse } from "@jderstd/core";
const route = (): Response => {
return createJsonResponse();
}And the response will be shown as below:
{
"success": true,
"data": null,
"errors": []
}This project is licensed under the terms of the MIT license.