This commit is contained in:
root 2026-03-31 20:00:02 -04:00
parent a343681321
commit 5f68544a95
3 changed files with 7 additions and 5 deletions

View File

@ -11,7 +11,7 @@ connectDB();
app.use(
cors({
origin: "http://localhost:5173",
origin: "*",
allowedHeaders: ["Content-Type", "Authorization"],
credentials: true,
}),

View File

@ -23,7 +23,9 @@ export const SocketProvider = ({ children }) => {
const userInfo = JSON.parse(localStorage.getItem("user"));
const newSocket = io(url, {
console.log(url.replace("game-api", "socket.io"));
const newSocket = io(url.replace("/game-api", ""), {
path: "/socket.io/",
auth: { token, username: userInfo?.username },
transports: ["websocket"],
reconnectionAttempts: 5,

View File

@ -13,7 +13,7 @@ const economyService = require("./game/EconomyService.js");
app.use(
cors({
origin: "http://localhost:5173",
origin: "*",
methods: ["GET", "POST"],
credentials: true,
}),
@ -50,7 +50,7 @@ const registerInApi = async () => {
try {
await axios.post(`${config.apiBaseUrl}/servers/register`, {
name: config.serverName,
url: `http://localhost:${config.port}`,
url: `https://dev-test.galaxystrike.online/game-api`,
secret: config.serverSecret,
isModded: false,
description: config.serverDescription,