0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-10 23:40:11 +00:00
healthchecks_healthchecks/templates/docs/javascript.md
2020-01-23 16:04:15 +02:00

397 B

Javascript

Below is an example of making a HTTP request to SITE_NAME from Node.js.

var https = require('https');
https.get("PING_URL");

You can also send pings from a browser environment. SITE_NAME sets the Access-Control-Allow-Origin:* CORS header, so cross-domain AJAX requests work.

var xhr = new XMLHttpRequest();
xhr.open('GET', 'PING_URL', true);
xhr.send(null);