feat: 在线双人五子棋(Socket.IO + Vue3 + Canvas)
- 服务端权威状态机:落子校验、四方向五连判胜、悔棋请求、认输、离线判负、交换黑白再来一局 - 断线重连:resumeToken 凭证 + localStorage,刷新/锁屏自动回到原座位 - 移动端 Canvas 棋盘:DPR 适配、触摸容差吸附、最后一手标记、胜利连子高亮 - Docker 多阶段构建,非 root + 只读根文件系统 - k8s 清单:单副本 Recreate(内存态房态)、Ingress WebSocket 超时与粘性会话注释
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// 前端源码在 web/,构建产物输出到项目根的 dist-web/,由 Node 服务端静态托管
|
||||
export default defineConfig({
|
||||
root: 'web',
|
||||
plugins: [vue()],
|
||||
build: {
|
||||
outDir: '../dist-web',
|
||||
emptyOutDir: true,
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
// 开发态把 Socket.IO 请求(含 WebSocket upgrade)转发给本地 Node 服务
|
||||
proxy: {
|
||||
'/socket.io': {
|
||||
target: 'http://127.0.0.1:3000',
|
||||
ws: true,
|
||||
},
|
||||
'/healthz': 'http://127.0.0.1:3000',
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user