UNPKG

intlayer-editor

Version:

Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.

26 lines (24 loc) 843 B
import { getDictionaries, writeContentDeclaration } from "../controllers/dictionary.controller.mjs"; import { getConfiguration } from "@intlayer/config/node"; //#region src/routes/dictionary.routes.ts const { editor } = getConfiguration(); const getBaseURL = () => `${editor.editorURL}/api/dictionary`; const getDictionaryRoutes = () => ({ getDictionaries: { urlModel: "/", url: getBaseURL(), method: "GET" }, writeContentDeclaration: { urlModel: "/", url: getBaseURL(), method: "POST" } }); const dictionaryRouter = async (fastify) => { fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries); fastify.post(getDictionaryRoutes().writeContentDeclaration.urlModel, writeContentDeclaration); }; //#endregion export { dictionaryRouter, getDictionaryRoutes }; //# sourceMappingURL=dictionary.routes.mjs.map