coloring
All checks were successful
deploy to production / deploy (push) Successful in 42s

This commit is contained in:
2023-12-07 20:24:09 +00:00
parent f85efb3c38
commit fd5af432db
52 changed files with 638 additions and 328 deletions

View File

@@ -1,21 +1,26 @@
const apiSsrBaseURL = "http://localhost:8080/api/v1/_/fontis_v2"
module.exports = {
apiSsrBaseURL,
ssrValidatePath: function (path) {
// validate if path ssr rendering is ok, -1 = NOTFOUND, 0 = NO SSR, 1 = SSR
// pe. use context.readCollection("product", {filter: {path: path}}) ... to validate dynamic urls
// / is de home
if (path == "/") return 1
// all other sites are in db
path = path?.replace(/^\//, "")
// // / is de home
// if (path == "/") return 1
// // all other sites are in db
//path = path?.replace(/^\//, "")
console.log("PATH:", path)
// filter for path or alternativePaths
const resp = context.db.find("content", {
const resp = context.db.find("page", {
filter: {
$or: [{ path }, { "alternativePaths.path": path }],
$and: [{ path }],
},
selector: { _id: 1 },
})
console.log("RESP:", resp?.length)
if (resp && resp.length) {
return 1
}
@@ -23,5 +28,5 @@ module.exports = {
// not found
return -1
},
ssrAllowedAPIEndpoints: ["content", "medialib"],
ssrPublishCheckCollections: ["page"],
}