isMyWebsiteDown
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Pass a URL to ping a website and see if response is a 200. If it isn't, you get an email with the error response received.
Tip: Make a new, separate cron val to call this isMyWebsiteDown()
periodically to check the website's health every 15 minutes or so.
Your separate cron val's code will look something like this:
//Import this val
import isMyWebsiteDown from "https://esm.town/v/dvsj/isMyWebsiteDown";
//Add all the websites you want to check
isMyWebsiteDown(`https://dvsj.in`);
isMyWebsiteDown(`https://blog.dvsj.in`);
export default {};