Files
say/server.js
T

19 lines
768 B
JavaScript

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));