Deployment¶
Build static files¶
Output goes to dist/.
Serve the dist/ directory with any static file server.
Node.js server¶
The server.js file provides a production Node.js server with an export API.
Environment variables:
| Variable | Default | Description |
|---|---|---|
| PORT | 80 | HTTP port |
| STATIC_DIR | ./dist | Static files directory |
| EXPORT_DIR | ./exports | Directory for exported maps |
Endpoints:
GET /serves the static filesPOST /api/exportsaves a map JSON to EXPORT_DIRGET /api/exportlists saved exports- All other routes fall back to index.html for SPA routing
Docker¶
Or use docker-compose:
The compose file mounts ./exports:/exports for persistent map exports.
nginx¶
An nginx.conf is included for nginx deployment.
It serves static files with SPA fallback and sets cache headers for keybinds.txt.
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
GitHub Pages¶
- Set the Vite base path in
vite.config.tsto your repo name - Enable GitHub Pages in your repo settings
- Push to the branch configured for Pages
The app loads the map specified in map.config.ts.
Place your exported JSON files in the maps/ directory and commit them.
Viewer mode¶
Append ?view to the URL to load the viewer instead of the editor.
Optionally append &map=path/to/map.json to load a specific map file.
Next steps¶
Read the Configuration reference for setup options. Read the Viewer Guide for embedding the viewer.