intlayer-editor
Version:
Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.
1 lines • 1.38 kB
Source Map (JSON)
{"version":3,"file":"dictionary.routes.mjs","names":["dictionaryRouter: Router"],"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport { Router } from 'express';\nimport type { Routes } from '@/types/Routes';\n\nexport const dictionaryRouter: Router = Router();\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\ndictionaryRouter.get(\n getDictionaryRoutes().getDictionaries.urlModel,\n getDictionaries\n);\ndictionaryRouter.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n);\n"],"mappings":";;;;;AAQA,MAAaA,mBAA2B,QAAQ;AAEhD,MAAM,EAAE,WAAW,kBAAkB;AAErC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,6BACV;CACC,iBAAiB;EACf,UAAU;EACV,KAAK,YAAY;EACjB,QAAQ;EACT;CACD,yBAAyB;EACvB,UAAU;EACV,KAAK,YAAY;EACjB,QAAQ;EACT;CACF;AAEH,iBAAiB,IACf,qBAAqB,CAAC,gBAAgB,UACtC,gBACD;AACD,iBAAiB,KACf,qBAAqB,CAAC,wBAAwB,UAC9C,wBACD"}