Skip to content

Commit

Permalink
add health check endpoint to server
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanthium7 committed Dec 28, 2024
1 parent 95d09f1 commit d5a7d61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ const { Server } = require("socket.io");
const roomChat = require("./roomChat");
const { useAzureSocketIO } = require("@azure/web-pubsub-socket.io");

const httpServer = createServer();
const httpServer = createServer((req, res) => {
if (req.method === "GET" && req.url === "/") {
res.writeHead(200, { "Content-Type": "text/plain" });
res.end("OK");
}
});
const io = new Server(httpServer, {
cors: {
origin: ["http://localhost:3000", "https://chillverse.vercel.app"],
Expand Down

0 comments on commit d5a7d61

Please sign in to comment.