fix strapi urls and shit
All checks were successful
Deployment / Deploy website (push) Successful in 2m32s
Deployment / Deploy strapi (push) Successful in 3m5s

This commit is contained in:
Benjamin Palko 2025-05-06 12:31:44 -04:00
parent 0e94cb95ca
commit 0eb91d67dd
8 changed files with 92 additions and 66 deletions

0
src/lib/server/index.ts Normal file
View file

View file

@ -0,0 +1,31 @@
import { strapi, type StrapiClient } from "@strapi/client";
export class Strapi {
private readonly client: StrapiClient;
constructor(
public readonly url: string,
auth: string,
) {
this.client = strapi({
baseURL: `${url}/api`,
auth: auth,
});
}
async Blogs() {
const blogs = this.client.collection("blogs");
return await blogs.find({
populate: ["Header", "Topics"],
});
}
async Blog(id: string) {
const blogs = this.client.collection("blogs");
return await blogs.findOne(id, {
populate: ["Header", "Topics"],
});
}
}