intlayer-editor
Version:
Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.
31 lines (29 loc) • 899 B
JavaScript
import { formatResponse } from "../utils/responseData.mjs";
import { getConfiguration as getConfiguration$1 } from "@intlayer/config/node";
//#region src/controllers/configuration.controller.ts
/**
* Get the Intlayer configuration
*/
const getConfiguration = async (_req, res) => {
try {
const formattedResponse = formatResponse({ data: getConfiguration$1() });
return res.send(formattedResponse);
} catch (err) {
const errorMessage = err ?? {
message: "Internal Server Error",
status: 500
};
const formattedErrorResponse = formatResponse({
error: {
message: errorMessage.message ?? "Internal Server Error",
code: "INTERNAL_SERVER_ERROR",
title: "Internal Server Error"
},
status: errorMessage.status ?? 500
});
return res.send(formattedErrorResponse);
}
};
//#endregion
export { getConfiguration };
//# sourceMappingURL=configuration.controller.mjs.map