Files
say/server.js
T

13 lines
375 B
JavaScript

const http = require('http');
const PORT = process.env.PORT || 3000;
http.createServer((req, res) => {
if (req.url === '/health') {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end('{"status":"ok"}');
} else {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Say OK');
}
}).listen(PORT, () => console.log(':' + PORT));