anujbugfixx/app.js
2026-03-16 20:24:59 +05:30

18 lines
433 B
JavaScript

const http = require('http');
const PORT = 8080;
const server = http.createServer((req, res) => {
if (req.method === 'GET' && req.url === '/') {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('2nd updateee Hello World');
} else {
res.writeHead(404, { 'Content-Type': 'text/plain' });
res.end('Not Found');
}
});
server.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});