@mapomodule/mapo-integrations-camomilla
mapo-integrations-camomilla 🌼
Mapo integration for Camomilla CMS. Implemented as a Nuxt module that adds a Nitro server middleware: every /api/* request is intercepted, path-rewritten to the matching Camomilla endpoint, and proxied to the backend with cookie/CSRF handling.
Installation
pnpm add mapo-integrations-camomilla
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["mapomodule", "mapo-integrations-camomilla"],
camomilla: {
server: "http://localhost:8000",
syncCamomillaSession: false,
base: "",
forwardedHeaders: [],
pathRewrite: {}, // merged on top of the built-in rewrites
skipPaths: [], // appended to the built-in skip list
changeOrigin: true,
},
});
What it does
- Path rewriting:
/api/auth/login→/api/camomilla/auth/login/,/api/profiles/me→/api/camomilla/users/current/,/api/media[-folders]→/api/camomilla/media[-folders],/api/menus→/api/camomilla/menus. Custom rewrites can be added via thepathRewriteoption. - Skip list:
/api/_nuxt_iconand/api/mockare never proxied. Add your own prefixes withskipPaths: ['/api/webhooks']to keep local server routes local — the values are appended to the built-in defaults, never replace them. - Cookie sync: maps Mapo's
__mapo_sessionto Django'ssessionidon outgoing requests, and aliasessessionidback to__mapo_sessionon auth-path responses. - CSRF: forwards
csrftokenasX-CSRFTokenon every non-login request. - Forwarded headers: optional whitelist of extra request headers to forward to the Camomilla backend.
Source of truth
All cookie names and Mapo-side path constants live in src/constants.ts — no magic strings in the proxy or cookie sync code.
Dev workflow
pnpm dev:camomilla # from monorepo root — watch mode
Reference
See docs/modules/camomilla for the full reference, and docs/modules/integrations-howto if you want to write your own backend integration.
Related Packages
@mapomodule/uikit
This is part of Mapo nuxt module. Injects Mapo ui components in the nuxt compone...
4,532
10
@mapomodule/utils
This is part of Mapo nuxt module. Provides a set of utils for the project.
1,287
10
Version History
| Version | Released | License |
|---|---|---|
| 1.0.0 | MIT |
Pre-releases (15)
| Version | Released | Vue | License |
|---|---|---|---|
| 2.0.0-beta.6 | ^3.0 | MIT | |
| 2.0.0-beta.5 | ^3.0 | MIT | |
| 2.0.0-beta.4 | ^3.0 | MIT | |
| 2.0.0-beta.3 | ^3.0 | MIT | |
| 2.0.0-beta.2 | ^3.0 | MIT | |
| 2.0.0-beta.1 | ^3.0 | MIT | |
| 1.0.0-alpha.11 | MIT | ||
| 1.0.0-alpha.10 | MIT | ||
| 1.0.0-alpha.9 | MIT | ||
| 1.0.0-alpha.8 | MIT | ||
| 1.0.0-alpha.7 | MIT | ||
| 1.0.0-alpha.6 | MIT | ||
| 1.0.0-alpha.5 | MIT | ||
| 1.0.0-alpha.4 | MIT | ||
| 1.0.0-alpha.3 | MIT |