nginx
This commit is contained in:
parent
a343681321
commit
5f68544a95
@ -11,7 +11,7 @@ connectDB();
|
||||
|
||||
app.use(
|
||||
cors({
|
||||
origin: "http://localhost:5173",
|
||||
origin: "*",
|
||||
allowedHeaders: ["Content-Type", "Authorization"],
|
||||
credentials: true,
|
||||
}),
|
||||
|
||||
@ -23,8 +23,10 @@ export const SocketProvider = ({ children }) => {
|
||||
|
||||
const userInfo = JSON.parse(localStorage.getItem("user"));
|
||||
|
||||
const newSocket = io(url, {
|
||||
auth: { token, username: userInfo?.username },
|
||||
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,
|
||||
});
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user