Initial commit

This commit is contained in:
AVS
2026-06-26 16:42:07 +05:00
commit da6b107066
17 changed files with 1448 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TNProxy - API Docs</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; padding: 20px; }
.container { max-width: 900px; margin: 0 auto; }
.nav { margin-bottom: 20px; }
.nav a { margin-right: 15px; color: #0088cc; text-decoration: none; }
.nav a:hover { text-decoration: underline; }
h1 { color: #333; margin-bottom: 20px; }
h2 { color: #555; margin-top: 30px; margin-bottom: 15px; }
.card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 20px; }
code { background: #f4f4f4; padding: 2px 6px; border-radius: 3px; font-family: monospace; }
pre { background: #2d2d2d; color: #f8f8f2; padding: 15px; border-radius: 5px; overflow-x: auto; }
.method { display: inline-block; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 12px; }
.method.get { background: #61affe; color: white; }
.method.post { background: #49cc90; color: white; }
.method.delete { background: #f93e3e; color: white; }
</style>
</head>
<body>
<div class="container">
<div class="nav">
<a href="/admin">Приложения</a>
<a href="/admin/api">API Docs</a>
</div>
<h1>API Документация</h1>
<div class="card">
<h2>Отправка сообщения</h2>
<p><span class="method post">POST</span> <code>/send</code></p>
<p><strong>Headers:</strong></p>
<ul>
<li><code>Content-Type: application/json</code></li>
<li><code>X-App-Token: &lt;ваш_токен_приложения&gt;</code></li>
</ul>
<p><strong>Body:</strong></p>
<pre>{"text": "Hello, World!"}</pre>
<h3>Пример PowerShell:</h3>
<pre>$body = @{text = "Alert!"} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8080/send" -Method Post -Body $body -Headers @{"Content-Type"="application/json"; "X-App-Token"="YOUR_APP_TOKEN"}</pre>
<h3>Пример cURL:</h3>
<pre>curl -X POST http://localhost:8080/send \
-H "Content-Type: application/json" \
-H "X-App-Token: YOUR_APP_TOKEN" \
-d '{"text": "Hello!"}'</pre>
</div>
<div class="card">
<h2>Проверка здоровья</h2>
<p><span class="method get">GET</span> <code>/health</code></p>
<pre>{"status": "ok"}</pre>
</div>
</div>
</body>
</html>