- server/db.ts: sql.js with migration system (hex_maps, hexes, hex_features) - server/routes/maps.ts: CRUD for hex maps - server/routes/hexes.ts: Bulk hex upsert, region load, sparse storage - server/index.ts: Express 5, CORS, tile serving, SPA fallback - src/data/api-client.ts: Frontend HTTP client for all API endpoints - src/main.ts: Auto-save with 1s debounce, load map state on startup - Port 3002 (Kiepenkerl uses 3001) - Graceful fallback when API unavailable (works without server too) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
545 B
TypeScript
29 lines
545 B
TypeScript
import { defineConfig } from 'vite';
|
|
import { resolve } from 'path';
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src'),
|
|
'@core': resolve(__dirname, 'core'),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
allowedHosts: ['hexifyer.davoryn.de'],
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3002',
|
|
changeOrigin: true,
|
|
},
|
|
'/tiles': {
|
|
target: 'http://localhost:3002',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
});
|