My backend (API endpoints) is running on https://localhost:44308/api. When that is the case, Nuxt3.js is giving the following error:
request to https://localhost:44308/api/menus failed, reason: self signed certificate ()
at async $fetchRaw2 (/C:/D/MyApp/Source/WebUser/app/node_modules/ohmyfetch/dist/chunks/fetch.mjs:131:20)
at async Proxy.fetchData (/C:/D/MyApp/Source/WebUser/app/.nuxt/dist/server/server.mjs:52133:22)
at async setup (/C:/D/MyApp/Source/WebUser/app/.nuxt/dist/server/server.mjs:68832:5)
My code :
async fetchData() {
const config = useRuntimeConfig();
const result = await $fetch(`${config.apiBase}/menus`, {
headers: {
"Content-Type": "application/json",
"Accept-Language": "en",
// Authorization: `Bearer ${useRuntimeConfig().apiSecret}`,
},
});
console.log(result);
return result;
}
What is the solution for this? I have seen threads suggesting to run Nuxt3.js. Someone please help me. Thank you very much