{"size": 539, "ext": "js", "max_stars_repo_path": "serverValid.js", "max_stars_repo_name": "Hooning/coffeeme_webhook", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "serverValid.js", "max_issues_repo_name": "Hooning/coffeeme_webhook", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "serverValid.js", "max_forks_repo_name": "Hooning/coffeeme_webhook", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.3684210526, "max_line_length": 75, "alphanum_fraction": 0.5510204082}
const REQUIRE_AUTH = true

//export js files
module.exports = {
    authCheck: function(req, authToken){
        // we have a simple authentication
        if (REQUIRE_AUTH) {
            if (req.headers['auth-token'] !== authToken) {
                return res.status(401).send('Unauthorized')
            }
        }
    },
    valCheck: function(req){
        // and some validation too
        if (!req.body || !req.body.result || !req.body.result.parameters) {
            return res.status(400).send('Bad Request')
        }
    },
}