const express = require('express')
const app = express()

let OK = 200;
let FAIL = 500;
let globalStatusCode = OK;

app.get('/', function (req, res) {
    console.log("Health")
    res.statusCode = globalStatusCode;
    res.send('Hello World')
})

app.get('/', function (req, res) {
    console.log("OK")
    globalStatusCode = OK;
    res.send('OK')
})

app.get('/', function (req, res) {
    console.log("FAIL")
    globalStatusCode = FAIL;
    res.send('FAIL')
})

console.log("Start")
app.listen(3000)
console.log("Started")