@wix/origami-site-express
v1.1.8
Published
Run an exported Wix origami site on Node with Express and Vite.
Maintainers
Keywords
Readme
@wix/origami-site-express
Runs an exported Wix origami site on Node with Express and Vite, on top of @wix/origami-site.
Design: docs/site-express-adapter-plan.md.
The site has no server code. Its scripts call the bin:
| Script | Command | What it does |
|---|---|---|
| yarn dev | origami-site-express dev | Vite in middleware mode + Express + the core in dev mode: hot reload, live routing |
| yarn build | origami-site-express build | Vite client build into dist/client, the route table into dist/server/origami-routes.json |
| yarn start | origami-site-express start | Serves dist/ with the core in prod mode. No Vite at runtime. Refuses to start without a matching build. |
PORT sets the port (default 3000). yarn dev listens on localhost only, because it serves the site's source
through Vite; set HOST=0.0.0.0 to reach it from another machine or a container. VITE_WIX_CLIENT_ID and VITE_WIX_METASITE_ID come from .env.
- The adapter loads
@wix/origami-sitefrom the site root, never its own copy. - In dev each request imports the core through Vite's module runner, so a linked core reloads on edit without a restart. An installed core loads once.
- HMR runs on the site's own port (
server.ws.server). - The page's essential Wix custom embeds (
resolution.embeds) go at the end of<head>, first in<body>and last in<body>; in dev aftervite.transformIndexHtml.
