This commit is contained in:
@@ -124,7 +124,7 @@ curl -X POST http://localhost:3000/clear-all-sms
|
|||||||
**Пример запроса:**
|
**Пример запроса:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl http://localhost:3000/balance
|
curl http://localhost:3000/balance.php
|
||||||
```
|
```
|
||||||
|
|
||||||
**Ответ:**
|
**Ответ:**
|
||||||
@@ -171,7 +171,7 @@ environment:
|
|||||||
- `POST /sms/send`
|
- `POST /sms/send`
|
||||||
- `GET /sms/view-all-sms`
|
- `GET /sms/view-all-sms`
|
||||||
- `POST /sms/clear-all-sms`
|
- `POST /sms/clear-all-sms`
|
||||||
- `GET /sms/balance`
|
- `GET /sms/balance.php`
|
||||||
- `GET /sms/` - веб-интерфейс
|
- `GET /sms/` - веб-интерфейс
|
||||||
|
|
||||||
Изменение порта в docker-compose.yml:
|
Изменение порта в docker-compose.yml:
|
||||||
|
|||||||
12
server.js
12
server.js
@@ -86,7 +86,17 @@ router.post("/clear-all-sms", (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// GET /balance - get account balance (SMSC API compatible)
|
// GET /balance - get account balance (SMSC API compatible)
|
||||||
router.get("/balance", (req, res) => {
|
router.get("/balance.php", (req, res) => {
|
||||||
|
const { login, psw } = req.query;
|
||||||
|
|
||||||
|
if (!login || !psw) {
|
||||||
|
return res.json({ error: "Отсутствуют обязательные параметры", error_code: 1 });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (login !== AUTH_LOGIN || psw !== AUTH_PASSWORD) {
|
||||||
|
return res.json({ error: "Ошибка авторизации", error_code: 2 });
|
||||||
|
}
|
||||||
|
|
||||||
res.json({ balance: "1000.00" });
|
res.json({ balance: "1000.00" });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user