intlayer-editor
Version:
Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.
26 lines (24 loc) • 874 B
JavaScript
import { getDictionaries, writeContentDeclaration } from "../controllers/dictionary.controller.mjs";
import { getConfiguration } from "@intlayer/config";
import { Router } from "express";
//#region src/routes/dictionary.routes.ts
const dictionaryRouter = Router();
const { editor } = getConfiguration();
const getBaseURL = () => `${editor.editorURL}/api/dictionary`;
const getDictionaryRoutes = () => ({
getDictionaries: {
urlModel: "/",
url: getBaseURL(),
method: "GET"
},
writeContentDeclaration: {
urlModel: "/",
url: getBaseURL(),
method: "POST"
}
});
dictionaryRouter.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);
dictionaryRouter.post(getDictionaryRoutes().writeContentDeclaration.urlModel, writeContentDeclaration);
//#endregion
export { dictionaryRouter, getDictionaryRoutes };
//# sourceMappingURL=dictionary.routes.mjs.map