Skip to content

Instantly share code, notes, and snippets.

@lorismaz
lorismaz / lambda-website-checker.js
Created March 7, 2018 13:37 — forked from marcelog/lambda-website-checker.js
This AWS Lambda can be used to check your website for availability
'use strict';
var url = require('url');
var target = 'http://www.yourwebsite.com'; // Change this one
exports.handler = function(event, context, callback) {
var urlObject = url.parse(target);
var mod = require(
urlObject.protocol.substring(0, urlObject.protocol.length - 1)
);