You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
577 B
18 lines
577 B
import PocketBase from "pocketbase";
|
|
|
|
export const dynamic = 'auto',
|
|
fetchCache = 'force-no-store'
|
|
|
|
async function getPosts() {
|
|
const client = new PocketBase('https://backend.saachen.lu');
|
|
const adminAuthData = await client.admins.authViaEmail(process.env.USERNAME, process.env.PASSWORD);
|
|
//console.log(adminAuthData);
|
|
const resultList = await client.records.getList('blogposts', 1, 50, {
|
|
filter: 'created >= "2022-01-01 00:00:00"',
|
|
expand: 'categories'
|
|
});
|
|
//console.log(resultList);
|
|
return resultList;
|
|
}
|
|
|
|
export default getPosts(); |