Start loading posts from Wordpress
This commit is contained in:
1 parent
95d4e45ef0
commit
2430b9f3eb
18 files changed
+48
-233
No files matched your search
@@ -0,0 +1,17 @@
|
||||
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: {
|
||||
"Authorization": `Basic lewis:${wordpressPassword}`
|
||||
}
|
||||
});
|
||||
|
||||
const responses = await response.json();
|
||||
|
||||
console.log(JSON.stringify(responses[0], null, 2));
|
||||
|
||||
return responses;
|
||||
};
|
||||
Reference in new issue
Block a user