feat: add server and frontend initial - wood chopping

This commit is contained in:
2026-09-05 16:37:45 +05:00
parent c79681dc59
commit f6c338e1b0
28 changed files with 1857 additions and 195 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env node
/* Отправить команду в мир через dev-эндпоинт (сервер должен быть запущен с DEV_HTTP=1):
node scripts/dev-cmd.mjs Тестер '!рубить' */
const [name, ...rest] = process.argv.slice(2);
const text = rest.join(' ');
if (!name || !text) {
console.error('usage: node scripts/dev-cmd.mjs <ник> <!команда>');
process.exit(1);
}
const res = await fetch('http://localhost:3000/dev/command', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ name, text }),
});
console.log(res.status, await res.text());