Merge branch 'main' of https://github.com/Korvarix/Galaxy-Strike-Online
This commit is contained in:
commit
4ea4d5276b
@ -11,7 +11,7 @@ connectDB();
|
|||||||
|
|
||||||
app.use(
|
app.use(
|
||||||
cors({
|
cors({
|
||||||
origin: "http://localhost:5173",
|
origin: "*",
|
||||||
allowedHeaders: ["Content-Type", "Authorization"],
|
allowedHeaders: ["Content-Type", "Authorization"],
|
||||||
credentials: true,
|
credentials: true,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -23,7 +23,9 @@ export const SocketProvider = ({ children }) => {
|
|||||||
|
|
||||||
const userInfo = JSON.parse(localStorage.getItem("user"));
|
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 },
|
auth: { token, username: userInfo?.username },
|
||||||
transports: ["websocket"],
|
transports: ["websocket"],
|
||||||
reconnectionAttempts: 5,
|
reconnectionAttempts: 5,
|
||||||
|
|||||||
@ -13,7 +13,7 @@ const economyService = require("./game/EconomyService.js");
|
|||||||
|
|
||||||
app.use(
|
app.use(
|
||||||
cors({
|
cors({
|
||||||
origin: "http://localhost:5173",
|
origin: "*",
|
||||||
methods: ["GET", "POST"],
|
methods: ["GET", "POST"],
|
||||||
credentials: true,
|
credentials: true,
|
||||||
}),
|
}),
|
||||||
@ -50,7 +50,7 @@ const registerInApi = async () => {
|
|||||||
try {
|
try {
|
||||||
await axios.post(`${config.apiBaseUrl}/servers/register`, {
|
await axios.post(`${config.apiBaseUrl}/servers/register`, {
|
||||||
name: config.serverName,
|
name: config.serverName,
|
||||||
url: `http://localhost:${config.port}`,
|
url: `https://dev-test.galaxystrike.online/game-api`,
|
||||||
secret: config.serverSecret,
|
secret: config.serverSecret,
|
||||||
isModded: false,
|
isModded: false,
|
||||||
description: config.serverDescription,
|
description: config.serverDescription,
|
||||||
|
|||||||
Reference in New Issue
Block a user