fazeel007 commited on
Commit
7841477
·
1 Parent(s): 30f57ca

Add ping endpoint for server health verification

Browse files

Added /ping endpoint to ensure server is responsive and help
debug connection issues. This provides a simple endpoint
to verify the server is running properly.

Files changed (1) hide show
  1. server/index.ts +4 -0
server/index.ts CHANGED
@@ -170,6 +170,10 @@ app.use((req, res, next) => {
170
  // doesn't interfere with the other routes
171
  console.log(`Environment: NODE_ENV=${process.env.NODE_ENV}, app.get('env')=${app.get('env')}`);
172
 
 
 
 
 
173
 
174
  if (process.env.NODE_ENV === "development") {
175
  console.log("Setting up Vite development server");
 
170
  // doesn't interfere with the other routes
171
  console.log(`Environment: NODE_ENV=${process.env.NODE_ENV}, app.get('env')=${app.get('env')}`);
172
 
173
+ // Add basic health endpoint before static serving to ensure server is responsive
174
+ app.get("/ping", (_req, res) => {
175
+ res.json({ status: "ok", timestamp: new Date().toISOString() });
176
+ });
177
 
178
  if (process.env.NODE_ENV === "development") {
179
  console.log("Setting up Vite development server");