diff --git a/backend/src/index.js b/backend/src/index.js index d28654d..9191234 100644 --- a/backend/src/index.js +++ b/backend/src/index.js @@ -12,7 +12,6 @@ const port = process.env.PORT || 3000; const app = express(); const server = createServer(app); - const dbConfig = { host: process.env.DB_HOST, user: process.env.DB_USER, @@ -32,6 +31,7 @@ async function connectDB() { } const io = new Server(server, { + path: "/api", cors: { origin: "https://worry-is-bubble.com", methods: ["GET", "POST"], diff --git a/frontend/src/controller/canvasController.js b/frontend/src/controller/canvasController.js index 2dc1aeb..3b23f8f 100644 --- a/frontend/src/controller/canvasController.js +++ b/frontend/src/controller/canvasController.js @@ -7,7 +7,7 @@ import io from "socket.io-client"; export default class CanvasController { constructor() { - this.socket = io(process.env.SOCKET_IP); + this.socket = io(process.env.SOCKET_IP, { path: "/api" }); this.canvas = document.getElementById("canvas"); this.canvas.width = window.innerWidth; this.canvas.height = window.innerHeight; diff --git a/frontend/src/controller/inputController.js b/frontend/src/controller/inputController.js index 3ae6836..4ecaa11 100644 --- a/frontend/src/controller/inputController.js +++ b/frontend/src/controller/inputController.js @@ -1,9 +1,10 @@ import io from "socket.io-client"; + export default class InputController { constructor() { this.input = document.getElementById("message_input"); this.button = document.getElementById("message_submit_button"); - this.socket = io(process.env.SOCKET_IP); + this.socket = io(process.env.SOCKET_IP, { path: "/api" }); } init() {