fix: нет зависимостей — чистый http без express

This commit is contained in:
2026-05-31 20:19:55 +03:00
parent 27969cd623
commit 14322799f6
3 changed files with 13 additions and 758 deletions
+11 -7
View File
@@ -1,8 +1,12 @@
const express = require('express');
const app = express();
app.get('/', (_req, res) => res.send('Say OK'));
app.get('/health', (_req, res) => res.json({ status: 'ok' }));
const http = require('http');
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => console.log(`:${PORT}`));
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));