tibi-docs/api/hooks/ssr/post_bind.js

26 lines
550 B
JavaScript
Raw Normal View History

2024-04-10 10:26:40 +02:00
const { release } = require("../config-client")
var utils = require("../lib/utils")
2023-02-21 14:00:56 +01:00
;(function () {
if (context.request().query("clear")) {
2024-04-10 10:26:40 +02:00
console.log("CLEARING SSR CACHE")
var removed = utils.clearSSRCache()
var stats = {
2023-02-21 14:00:56 +01:00
status: 200,
2024-04-10 10:26:40 +02:00
message: "ok",
removed: removed,
release: release,
2023-02-21 14:00:56 +01:00
}
2024-04-10 10:26:40 +02:00
utils.log(stats)
throw stats
2023-02-21 14:00:56 +01:00
}
throw {
status: 500,
message: "ssr is only a dummy collection",
2024-04-10 10:26:40 +02:00
release: release,
2023-02-21 14:00:56 +01:00
}
})()