const { release } = require("../config-client")
var utils = require("../lib/utils")

;(function () {
    if (context.request().query("clear")) {
        console.log("CLEARING SSR CACHE")
        var removed = utils.clearSSRCache()
        var stats = {
            status: 200,
            message: "ok",
            removed: removed,
            release: release,
        }

        utils.log(stats)

        throw stats
    }

    throw {
        status: 500,
        message: "ssr is only a dummy collection",
        release: release,
    }
})()
