I’m trying to make a request in the builder api content in localhost but I’m receiving CORS error. I’m using NextJs and the project is already setting apiKey.
example query:
const getArticles = async (name: string) => {
try {
const response = await builder.get(‘pible-page-article’, {
query: {
name: { $regex: .*${name}.*
, $options: ‘i’ },
},
});
return response.data.results;
} catch (error) {
console.error('Error:', error);
throw error;
}
};
I already tried something like this
const getArticles = async (name: string) => {
try {
const response = await builder.get(‘pible-page-article’});
return response;
} catch (error) {
console.error('Error:', error);
throw error;
}
};