Client Side Rendering
i have a nuxt 3 app, it has following directory structure:
myApp
apps (there are others which I do not think are important to mention)
server -> it has customQueries and src folder and middleware configs among others
web -> it has pages, assets, components, config, sdk, server, layouts, composables, utils etc.
when I run my app with yarn, I run it from inside myApp directory. it runs both the server and the web. that was essentially because we want to utilize power of server and send our magento queries through sdk, which goes through our server to the magento. later, we decided to get rid of sdk and send direct calls to magento and for that we created a function inside web/server directory and added code for JS fetch api, that would be sending calls to the magento url. Now, to use that api, we employed useFetch of nuxt 3 in each composable to send call to the api and then that would call the magento backend. but when I run the code from web directory to bypass the server, nothing happens and no network call is seen, which otherwise would occur even if I use fetch api. how can I fix this?
PS: the method works for homepage banners and messages but it doesn't work of product page. (these are the only places I have implemented it yet).
0 Replies