It is common for web developers to have local “debug” version of website and production version.

For example, in debug version you may have uncompressed, full version of JavaScript files for easier debugging and diagnostics, while in production environment you often deploy smaller and thus faster versions of same files.

To automatically detect situation where you mistakenly published debug version into production environment, you can use free AppBeat account to monitor your web page and alert you of such mistakes. Here is short tutorial how to do this.

Once you are logged-in, click on “Add new check” button which opens “New check” dialog.

On first step simply enter name of your monitor. It is nice to have good name because it will be included in SMS / email notifications:

On second step you enter URL of your page and then click on “Warning” or “Error” tab. Now enter rule similar to this:

In our example we entered warning rule:

NOT(MATCH(%RESPONSE%, “https://appbeat.io/assets/js/AppBeat.min.js"))

When web page from provided URL is downloaded (in our example https://my.appbeat.io/manage/) it is processed first by Error rule, then by Warning rule and finally by Good rule (this is how rules are prioritized). If Error or Warning rules are evaluated to TRUE, notification alert is immediately triggered.

In contrast to Error/Warning rules, Good rule must evaluate to TRUE to be treated as OK. If FALSE is returned it means check is not good and alert is immediately triggered.

If we return again to our rule example:

NOT(MATCH(%RESPONSE%, “https://appbeat.io/assets/js/AppBeat.min.js"))

It simply says that if HTML response from our web server does not contain string https://appbeat.io/assets/js/AppBeat.min.js it triggers Warning signal and then we are notified about this by SMS or email.

If our web site contains correct (minified) version of AppBeat script (AppBeat.min.js), this rule evaluates to FALSE, which means there is no warning. On the other hand, if we mistakenly publish HTML file which contains link to AppBeat.js, rule would evaluate to TRUE and trigger warning.

This is one simple example on how to effectively use AppBeat in real life. Hope it helps you too!