feat: Node.js — чистый http, /api/profiles, 0 зависимостей

This commit is contained in:
2026-06-01 21:42:00 +03:00
parent 9406b7d159
commit 0244f2f612
11 changed files with 39 additions and 574 deletions
+19
View File
@@ -0,0 +1,19 @@
const http = require('http');
const PORT = process.env.PORT || 3000;
http.createServer((req, res) => {
if (req.url === '/healthz') {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end('{"status":"ok"}');
} else if (req.url === '/api/profiles') {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify([
{"id": "ddm", "name": "DDM-120", "desc": "Быстрая модель"},
{"id": "qwen", "name": "Qwen", "desc": "Мощная модель"},
{"id": "deepseek", "name": "DeepSeek", "desc": "Глубокая аналитика"},
]));
} else {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Say OK');
}
}).listen(PORT, () => console.log(':' + PORT));