feat: Node.js server + editor save/load + keyboard controls
- Replace nginx with Node.js server that serves static files AND provides API endpoints for reading/writing maps.js directly (GET/PUT /api/maps). Creates .bak backup before each save. - Editor: arrow keys to pan, +/- to zoom, Ctrl+S to save - Editor: "Save" button writes maps.js directly on the server - Editor: "Load" button reads and parses maps.js from server - Editor: auto-loads from server on page open - Dockerfile changed from nginx:alpine to node:20-alpine Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -1,7 +1,11 @@
|
||||
FROM nginx:alpine
|
||||
COPY index.html /usr/share/nginx/html/
|
||||
COPY editor.html /usr/share/nginx/html/
|
||||
COPY css/ /usr/share/nginx/html/css/
|
||||
COPY js/ /usr/share/nginx/html/js/
|
||||
COPY assets/ /usr/share/nginx/html/assets/
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
COPY server.js .
|
||||
RUN mkdir -p public
|
||||
COPY index.html public/
|
||||
COPY editor.html public/
|
||||
COPY css/ public/css/
|
||||
COPY js/ public/js/
|
||||
COPY assets/ public/assets/
|
||||
EXPOSE 80
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
Reference in New Issue
Block a user