Spaces:
Sleeping
Sleeping
Update server.js
Browse files
server.js
CHANGED
|
@@ -11,8 +11,12 @@ app.post('/fetch-sheet', async (req, res) => {
|
|
| 11 |
return res.status(400).json({ error: '❌ Ошибка данных, повторите попытку.' });
|
| 12 |
}
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
try {
|
| 15 |
-
const url = `https://opensheet.elk.sh/${
|
| 16 |
const response = await axios.get(url);
|
| 17 |
const data = response.data;
|
| 18 |
|
|
|
|
| 11 |
return res.status(400).json({ error: '❌ Ошибка данных, повторите попытку.' });
|
| 12 |
}
|
| 13 |
|
| 14 |
+
// Экранирование значений для использования в URL
|
| 15 |
+
const encodedKey = encodeURIComponent(key);
|
| 16 |
+
const encodedList = encodeURIComponent(list);
|
| 17 |
+
|
| 18 |
try {
|
| 19 |
+
const url = `https://opensheet.elk.sh/${encodedKey}/${encodedList}`;
|
| 20 |
const response = await axios.get(url);
|
| 21 |
const data = response.data;
|
| 22 |
|