Upd
This commit is contained in:
1 parent
c7ceebde08
commit
34dd004a06
50 files changed
+20222
-11637
No files matched your search
+1
-3
@@ -27,19 +27,17 @@ createServer((req, res) => {
|
||||
const name = String(body.name ?? '').trim();
|
||||
const contact = String(body.contact ?? '').trim();
|
||||
const message = String(body.message ?? '').trim();
|
||||
const budget = String(body.budget ?? '').trim();
|
||||
if (!name || !contact || !message) {
|
||||
return send(res, 422, false, 'name, contact, message — обязательные поля.');
|
||||
}
|
||||
console.log('\n=== НОВОЕ СООБЩЕНИЕ (stub) ===');
|
||||
console.log('Имя: ', name);
|
||||
console.log('Связь: ', contact);
|
||||
console.log('Бюджет: ', budget || '—');
|
||||
console.log('Задача: ', message);
|
||||
console.log('================================\n');
|
||||
send(res, 200, true, 'Сообщение отправлено (stub). Мы ответим в ближайшее время.');
|
||||
});
|
||||
}).listen(PORT, HOST, () => {
|
||||
console.log(`Contact stub: http://${HOST}:${PORT}`);
|
||||
console.log('POST JSON {name, contact, message, budget?}');
|
||||
console.log('POST JSON {name, contact, message}');
|
||||
});
|
||||
Reference in new issue
Block a user