карта ПВЗ
All checks were successful
Deploy / build (push) Successful in 2m22s

This commit is contained in:
alsaze
2025-10-15 15:15:28 +03:00
parent d038b66c94
commit b06786ad96
8 changed files with 18032 additions and 2180 deletions

31
server/api/yandex.ts Normal file
View File

@@ -0,0 +1,31 @@
import axios from 'axios'
import { defineEventHandler } from 'h3'
export default defineEventHandler(async () => {
const token = 'y2_AgAAAAD04omrAAAPeAAAAAACRpC94Qk6Z5rUTgOcTgYFECJllXYKFx8'
try {
const response = await axios.post(
'https://b2b.taxi.tst.yandex.net/api/b2b/platform/pickup-points/list',
{
filters: {
region_ids: [213],
},
limit: 5,
},
{
headers: {
'Content-Type': 'application/json',
'Accept-Language': 'ru-RU',
'Authorization': `Bearer ${token}`,
},
},
)
return response.data
}
catch (error) {
console.error('Ошибка при запросе к Яндекс API:', error)
return { error: 'Не удалось получить точки ПВЗ' }
}
})