mirror of
https://github.com/MaggieAppleton/digital-gardeners.git
synced 2024-11-21 17:09:45 +01:00
23 lines
521 B
JavaScript
23 lines
521 B
JavaScript
const dotenv = require("dotenv");
|
|
const fetch = require("node-fetch");
|
|
const algoliasearch = require("algoliasearch/lite");
|
|
|
|
async function getAllBlogPosts() {
|
|
// write your code to fetch your data
|
|
}
|
|
|
|
(async function () {
|
|
// initialize environment variables
|
|
dotenv.config();
|
|
|
|
try {
|
|
// fetch your data
|
|
const posts = await getAllBlogPosts();
|
|
|
|
}
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
})();
|
|
|
|
// To be continued: https://www.contentful.com/blog/2021/07/02/add-algolia-instantsearch-to-nextjs-app/
|