nopalm
Version:
One stop graphical solution to create and manage your local Node.Js projects end to end.
16 lines (13 loc) • 438 B
JavaScript
const http = require('http');
const server = http.createServer((req, res) => {
if (req.url === '/ping' && req.method === 'GET') {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World!');
} else {
res.writeHead(404, { 'Content-Type': 'text/plain' });
res.end('Not Found');
}
});
server.listen(4000, () => {
console.log('Server running at http://localhost:4000');
});