{
  "schema": "leumas.docs.page/1",
  "id": "pkg:@leumas/static-pages",
  "slug": "engines/static-pages",
  "kind": "capabilities",
  "bucket": "package",
  "title": "@leumas/static-pages",
  "name": "@leumas/static-pages",
  "eyebrow": null,
  "chip": null,
  "summary": "Imperium static-pages plugin router — CRUD over on-disk per-config page files (.json/.md/.html/.jsx). Consolidates the read-only StaticPages fetch/list router into a full CRUD surface for Studio.",
  "keywords": [
    "static-pages",
    "per-config",
    "staticpages",
    "on-disk",
    "read-only",
    "static pages api",
    "leumas static pages",
    "plugin"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# @leumas/static-pages\n\nImperium **static-pages** plugin router — CRUD over an on-disk, per-config corpus of page files\n(`.json` / `.md` / `.html` / `.jsx`). Each config folder is one subdomain's static-page set (the\n`z.Domains2/StaticPages` model). Mounted by `leumas-api` alongside the other `router-kit` routers.\n\n**Absorbs (DRY-consolidated from):** `z.Domains2/Router/StaticPages` — `router.js` +\n`handlers/{list-pages,fetch-page}` + `utils/{file,request,response}`. The legacy router was read-only\n(list + fetch); this adds the write half (create/overwrite/delete pages and config folders) so Studio\ncan *manage* pages, not just serve them.\n\n## Endpoints\n\n| Method | Path              | Does                                             |\n| ------ | ----------------- | ------------------------------------------------ |\n| GET    | `/`               | list config folders                              |\n| POST   | `/`               | `{ config }` → create a config folder            |\n| DELETE | `/:config`        | delete a config folder                           |\n| GET    | `/:config`        | list page files in a config                      |\n| GET    | `/:config/:page`  | read a page (`.json` parsed, else raw string)    |\n| PUT    | `/:config/:page`  | `{ content }` → create/overwrite a page          |\n| DELETE | `/:config/:page`  | delete a page                                    |\n\nEvery response is `{ status: 'success', data }` or `{ status: 'error', message }` (legacy shape kept).\n\n## Usage (in leumas-api)\n\n```js\nimport { createStaticPagesRouter } from '@leumas/static-pages';\nimport { requireAuth } from '@leumas/auth';\n\napp.use('/api/static-pages', createStaticPagesRouter({\n  base: process.env.STATIC_PAGES_DIR,   // absolute path to the StaticPages root\n  gate: requireAuth(),                  // protects create/update/delete; reads stay public\n}));\n```\n\nPath traversal is refused — a config can only touch files inside its own folder. Import\n`createStore({ base })` directly if you want the filesystem CRUD without Express.\n",
  "source": {
    "path": "shared/engines/plugins/router-kit/static-pages/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 2269,
    "hash": "c3bd08417197a9714501cd63dca85e1deb850be7"
  },
  "urls": {
    "html": "/p/engines/static-pages",
    "json": "/docs/engines/static-pages.json",
    "md": "/docs/engines/static-pages.md"
  },
  "links": {
    "composes": [],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  },
  "exports": null
}
