Files
mqtt-ingest/app/src/cloud-ingest.ts
Первов Артем 10dbdb2120 correction after review
2026-06-19 08:17:35 +03:00

16 lines
442 B
TypeScript

const DEFAULT_CLOUD_INGEST_URL = 'http://localhost:3101/ingest'
export const cloudIngestUrl =
process.env.CLOUD_INGEST_URL ?? DEFAULT_CLOUD_INGEST_URL
export function postCloudIngest(body: unknown): Promise<Response> {
return fetch(cloudIngestUrl, {
method: 'POST',
headers: {
'content-type': 'application/json',
'x-api-key': process.env.CLOUD_INGEST_API_KEY as string,
},
body: JSON.stringify(body),
})
}