UNPKG

intlayer-editor

Version:

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

1 lines 1.44 kB
{"version":3,"file":"dictionary.routes.cjs","names":["getDictionaries","writeContentDeclaration"],"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\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\nexport const dictionaryRouter = async (fastify: FastifyInstance) => {\n fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);\n fastify.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n );\n};\n"],"mappings":";;;;;AAQA,MAAM,EAAE,uDAA4B;AAEpC,MAAM,mBAAmB,GAAG,OAAO,UAAU;AAE7C,MAAa,6BACV;CACC,iBAAiB;EACf,UAAU;EACV,KAAK,WAAW;EAChB,QAAQ;CACV;CACA,yBAAyB;EACvB,UAAU;EACV,KAAK,WAAW;EAChB,QAAQ;CACV;AACF;AAEF,MAAa,mBAAmB,OAAO,YAA6B;CAClE,QAAQ,IAAI,oBAAoB,CAAC,CAAC,gBAAgB,UAAUA,yDAAe;CAC3E,QAAQ,KACN,oBAAoB,CAAC,CAAC,wBAAwB,UAC9CC,iEACF;AACF"}