A response builder for Express.
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 type { Request, Response } from "express";
import { createJsonResponse } from "@jderstd/express";
const route = (req: Request, res: Response): Response => {
return createJsonResponse(res);
}And the response will be shown as below:
{
"success": true
}For the documentation, please refer to the documentation.
For the package APIs, please refer to the APIs.
This project is licensed under the terms of the MIT license.