Deploying to Flexweg
Once you have a dist/ folder (either built locally with npm run build or downloaded from a release), deploying to Flexweg means uploading two folders to two specific locations on your Flexweg site.
What goes where
dist/
├── admin/ → upload to /admin/ on Flexweg
└── theme-assets/ → upload to /theme-assets/ on Flexweg (site root)
The split mirrors the public site layout:
- Every published page contains
<link rel="stylesheet" href="/theme-assets/<theme-id>.css">— that's whytheme-assets/lives at the site root, not under/admin/. - The admin SPA lives entirely under
/admin/(or whatever you renamed the folder to — see Renaming the admin folder).
First deploy
- Open your Flexweg dashboard → File manager.
- Create a folder named
admin/at the root of your site. - Upload the contents of
dist/admin/(not the folder itself — its contents) into theadmin/folder. After this you should have on Flexweg:
/admin/
├── index.html
├── config.js
├── external.default.json
├── assets/
├── runtime/
├── plugins/
│ ├── core-seo/
│ ├── flexweg-archives/
│ ├── flexweg-rss/
│ ├── flexweg-search/
│ └── flexweg-sitemaps/
└── themes/
├── corporate/
└── magazine/
- Upload the contents of
dist/theme-assets/into your site root. After this:
/theme-assets/
├── corporate.css
├── corporate-menu.js
├── corporate-posts.js
├── default.css
├── default-menu.js
├── default-posts.js
├── magazine.css
├── magazine-menu.js
└── magazine-posts.js
- Open
https://<your-site>/admin/in your browser. The first-run setup wizard appears. Follow First-run setup form.
Subsequent deploys
When you have a new build (e.g. after updating the admin's source code):
- Re-upload
dist/admin/entirely. Replace whatever is on Flexweg. This is safe — your user state lives in Firestore, not in the admin folder. - Re-upload
dist/theme-assets/to refresh the public-facing theme CSS. Existing published pages reference these files, so updating them takes effect on the next page load (visitors see the new CSS without you re-publishing every page). - Open the admin — no setup wizard appears (config.js was already filled). Hard-refresh in your browser (Cmd+Shift+R / Ctrl+F5) to bypass any cached old admin assets.
What you DON'T need to redeploy:
- Your published pages (they're under
/<category>/and/<page-slug>.htmletc., untouched by an admin upgrade) /menu.json,/posts.json,/sitemap-*.xml,/rss.xml— these stay as the publisher last wrote them- Your media files under
/media/
What gets refreshed:
- The admin SPA (
/admin/) — a fresh build - The public theme CSS / JS (
/theme-assets/) — must match the new admin to avoid mismatched references
The list of installed externals (which plugins/themes are active vs uninstalled), all your post drafts, your settings, your plugin configs — none of these live in admin/. They live in Firestore (settings/externalRegistry, posts/{id}, settings/site, settings/site.pluginConfigs, etc.). Redeploying admin/ refreshes the admin code without touching any of that.
This is a deliberate architectural choice — see How it works and Operations: Updating the admin.
Upload methods
Flexweg's File manager UI lets you drag-and-drop folders. For larger admins or batch deploys, two alternatives:
Via Flexweg's "ZIP and drop" feature
- ZIP
dist/admin/'s contents (notdist/admin/itself; ZIP its contents). - Drag the ZIP into Flexweg's file manager.
- Flexweg unzips it server-side. Make sure the destination is
/admin/(or your renamed folder).
Same for dist/theme-assets/ → ZIP its contents, drop, target /theme-assets/.
Via the Files API
If you have many sites or want to script the deploy, use Flexweg's Files API:
# Upload one file
curl -X POST "https://www.flexweg.com/api/v1/files/upload" \
-H "X-API-Key: $FLEXWEG_API_KEY" \
-H "Content-Type: application/json" \
-d '{"path":"admin/index.html","content":"<base64-or-utf8>"}'
A small shell or Node script can walk dist/ and POST every file. The Files API supports both UTF-8 (text files) and base64 (binary) uploads.
Verifying the deploy
After uploading:
- Open
https://<your-site>/admin/— admin shell loads (login screen or dashboard). - Open browser DevTools → Network tab → reload. Verify:
index.htmlreturns 200config.jsreturns 200 with your Firebase values (or null on first deploy)assets/index-<hash>.jsreturns 200external.default.jsonreturns 200 with the bundled plugins/themes list
- Console should show no errors. Common issues:
NS_ERROR_CORRUPTED_CONTENT/ MIME type "text/html" onassets/index-<hash>.js→ the file isn't actually deployed; Flexweg is returning the SPA fallback. Re-upload missing files.Could not read external registry→ check thatexternal.default.jsonis at/admin/external.default.json.- 404 on
runtime/react.js→ theruntime/folder didn't upload. Re-upload it.
Renaming the admin folder
You can rename /admin/ to anything — /erf34f654GH3/, /dashboard/, whatever — for a slight obscurity boost. The admin auto-detects its folder name on every load.
See Renaming the admin folder for the rules and caveats.
Continue
- First-run setup form — connect Firebase + Flexweg
- Renaming the admin folder — security through obscurity
- Updating the admin — upgrade workflow