npm workspaces, NodeNext for server

This commit is contained in:
Nathaniel Tampus
2023-02-05 13:49:40 +08:00
parent dc233b2c84
commit bd39cf8c46
49 changed files with 129 additions and 1605 deletions

View File

@@ -1,7 +1,7 @@
import { activeGames } from "../db/models/game.model";
import { activeGames } from "../db/models/game.model.js";
import type { Socket } from "socket.io";
import { Chess } from "chess.js";
import { io } from "../server";
import { io } from "../server.js";
export async function joinLobby(this: Socket, gameCode: string) {
const game = activeGames.find((g) => g.code === gameCode);

View File

@@ -1,6 +1,13 @@
import type { Socket } from "socket.io";
import { io } from "../server";
import { joinLobby, leaveLobby, getLatestGame, sendMove, joinAsPlayer, chat } from "./game.socket";
import { io } from "../server.js";
import {
joinLobby,
leaveLobby,
getLatestGame,
sendMove,
joinAsPlayer,
chat
} from "./game.socket.js";
const socketConnect = (socket: Socket) => {
const req = socket.request;