Skip to content

A self-hosted UPI & COD payment gateway with zero per-transaction platform fees, universal JavaScript checkout integration, dynamic QR payments, WhatsApp OTP authentication, and automated payment verification.

JavaScript

Add Render demo health check

rafiq15066ee89ce6eb77
diff --git a/render.yaml b/render.yaml
index b98d78b..554b7e4 100644
--- a/render.yaml
+++ b/render.yaml
@@ -5,7 +5,7 @@ services:
runtime: node
plan: free
buildCommand: npm ci
- startCommand: npm run start:prod:api
+ startCommand: node scripts/start-render-demo.js
healthCheckPath: /health
envVars:
diff --git a/scripts/start-render-demo.js b/scripts/start-render-demo.js
new file mode 100644
index 0000000..354b98f
--- /dev/null
+++ b/scripts/start-render-demo.js
@@ -0,0 +1,37 @@
+import http from 'node:http';
+
+// Render automatically provides the PORT environment variable
+const PORT = Number(process.env.PORT || 10000);
+
+const server = http.createServer((req, res) => {
+
+ // Health check endpoint for Render and UptimeRobot
+ if (req.url === '/health') {
+ res.writeHead(200, {
+ 'Content-Type': 'application/json'
+ });
+
+ res.end(JSON.stringify({
+ status: 'UP',
+ service: 'youpi-pg-demo',
+ timestamp: new Date().toISOString()
+ }));
+
+ return;
+ }
+
+ // Temporary placeholder until full demo is configured
+ res.writeHead(503, {
+ 'Content-Type': 'text/plain; charset=utf-8'
+ });
+
+ res.end(
+ 'YouPI-PG demo website is not enabled yet. ' +
+ 'Payment functionality is disabled.'
+ );
+});
+
+// Start server
+server.listen(PORT, '0.0.0.0', () => {
+ console.log(`YouPI-PG server running on port ${PORT}`);
+});
\ No newline at end of file