PopcornPing / backend /minimal.js
Yash Goyal
Correction
2070fe3
raw
history blame contribute delete
489 Bytes
const http = require('http');
// 1. MUST use port 7860
const PORT = 7860;
// 2. MUST use host '0.0.0.0' (Not localhost!)
const HOST = '0.0.0.0';
const server = http.createServer((req, res) => {
console.log(`Request received: ${req.url}`); // Log every hit
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('SUCCESS: The Backend is Reachable on Port 7860!');
});
server.listen(PORT, HOST, () => {
console.log(`Minimal server running at http://${HOST}:${PORT}/`);
});