From 5f92b3988bbdc6a4a87d7c4f04869defb96a7a98 Mon Sep 17 00:00:00 2001 From: DongHyeonWon Date: Sun, 28 Jul 2024 11:51:55 +0900 Subject: [PATCH] =?UTF-8?q?chore=20:=20=EA=B2=BD=EB=A1=9C=20/api=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/index.js | 2 +- frontend/src/controller/canvasController.js | 2 +- frontend/src/controller/inputController.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) 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() {