저는 디스코urses에 처음 사용하는 사용자입니다. 제 React 앱에 Discourse 댓글 기능을 구현하려고 하는데, 제 입장에서는 매우 복잡해 보입니다. axios 또는 fetch로 호출할 수 있는 간단한 공개 API가 있을까요? API 키와 사용자명을 사용해 시도해 보았지만, 다음과 같은 axios 오류가 발생했습니다:
const fetchComments = async () => {
try {
const response = await axios(
'https://discourse.mydomain.com/t/category/13.json',{
headers: {
'Api-Key': apiKey,
'Api-Username': apiUsername
}
}
)
.then(data=>datas.json())
.then(checkData=>console.log(checkData)
console.log("discourse",response)
} catch (error) {
console.error('Error fetching comments:', error);
}
};```