A simple script that attempts to fetch one or more URLs and sends an email alert if one or more of them are down.
- Clone this repo
- Navigate to this repo's folder
- Create an
.env.local
file at the root level and add values to the following variables:
SENDGRID_API_KEY=""
URLS_SEPARATED_BY_A_SPACE=""
- Run
npm install
- Run
npm run check
- If you want these checks to run automatically on a schedule:
a. Edit the paths in
check.sh
to match your local folder structure b. Runchmod +x check.sh
to makecheck.sh
executable c. Use a cron job (or an app like Lingon) to schedulecheck.sh
to run every day, week, etc.