Start loading posts from Wordpress

This commit is contained in:
Lewis Dale committed 2023-02-16 08:34:36 +00:00
1 parent 2430b9f3eb
commit 09ac787260
2 files changed
+13 -9

No files matched your search

+3 -6
View File
@@ -1,7 +1,5 @@
const wordpressPassword = process.env.WORDPRESS_PASSWORD;
module.exports = async () => {
const response = await fetch("https://lewisdale.dev/wp-json/wp/v2/posts?per_page=100", {
headers: {
@@ -9,9 +7,8 @@ module.exports = async () => {
}
});
const responses = await response.json();
const posts = await response.json();
console.log(JSON.stringify(responses[0], null, 2));
return responses;
console.log(posts.map(post => Buffer.from(post.title.rendered).toString("utf-8")));
return posts;
};