<commit_before>"use strict";

var debug         = require("debug")("OSMBC:routes:api");
var express       = require("express");
var userModule    = require("../model/user.js");
var publicRouter  = express.Router();
var async         = require("async");
var htmltitle     = require("../model/htmlTitle.js");
var util          = require("../util.js");
var articleModule = require("../model/article.js");
var config        = require("../config.js");


// If function is called just return OK
function isServerUp(req, res, next) {
  debug("isServerUp");
  var apiKey = req.params.apiKey;
  if (apiKey !== config.getValue("apiKey")) {
    let err = new Error("Not Authorised");
    err.status = 401;
    err.type = "API";
    return next(err);
  }
  res.end("OK");
}

// If function is called query a postgres user,
// and check, wether there is a postgres error
function isPostgresUp(req, res, next) {
  debug("isPostgresUp");
  var apiKey = req.params.apiKey;
  if (apiKey !== config.getValue("apiKey")) {
    let err = new Error("Not Authorised");
    err.status = 401;<commit_msg>Filename<commit_after>"use strict";

var debug         = require("debug")("OSMBC:routes:api");
var express       = require("express");
var userModule    = require("../model/user.js");
var publicRouter  = express.Router();
var async         = require("async");
var htmltitle     = require("../model/htmltitle.js");
var util          = require("../util.js");
var articleModule = require("../model/article.js");
var config        = require("../config.js");


// If function is called just return OK
function isServerUp(req, res, next) {
  debug("isServerUp");
  var apiKey = req.params.apiKey;
  if (apiKey !== config.getValue("apiKey")) {
    let err = new Error("Not Authorised");
    err.status = 401;
    err.type = "API";
    return next(err);
  }
  res.end("OK");
}

// If function is called query a postgres user,
// and check, wether there is a postgres error
function isPostgresUp(req, res, next) {
  debug("isPostgresUp");
  var apiKey = req.params.apiKey;
  if (apiKey !== config.getValue("apiKey")) {
    let err = new Error("Not Authorised");
    err.status = 401;
{'fraction_non_alphanumeric': 0.1672085462145843, 'fraction_numerical': 0.00557361820715281, 'mean_word_length': 3.3166332665330662, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4573945', 'n_tokens_mistral': 679, 'n_tokens_neox': 665, 'n_words': 185}