mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
14 lines
369 B
TypeScript
14 lines
369 B
TypeScript
|
import fetch from 'node-fetch';
|
||
|
const ASTRO_TELEMETRY_ENDPOINT = `https://telemetry.astro.build/api/v1/record`;
|
||
|
const noop = () => {};
|
||
|
|
||
|
export function post(body: Record<string, any>) {
|
||
|
return fetch(ASTRO_TELEMETRY_ENDPOINT, {
|
||
|
method: 'POST',
|
||
|
body: JSON.stringify(body),
|
||
|
headers: { 'content-type': 'application/json' },
|
||
|
})
|
||
|
.catch(noop)
|
||
|
.then(noop, noop);
|
||
|
}
|