About request log from middleware to magento
hi everyone
I hope this message finds you well. I am reaching out today to ask for some guidance regarding a challenge I'm facing. Specifically, I need to inspect the requests (including headers) sent from Nuxt(is middleware) to Magento, and I'm not quite sure about the best way to accomplish this.
I've attempted to log requests in plugins and middleware. While this did give me some request records, it seems that those are only requests made between the browser and the middleware, which isn't seem exactly what I need.
I also tried to intercept requests after creating an
Axios interceptors.request
after const client = axios.create(config.axios)
However, this didn't provide me with any different results.
I noticed that @vue-storefront/magento-api
imports Apollo, but after checking the corresponding config files in the project, I still didn't find the information I was looking for.
My goal is to obtain the actual requests made to the Magento endpoint, such as https://localhost:3001/graphql?query=query+getStoresAndCurrencies%7BavailableStores%7Bstore_code+__typename%7Dcurrency%7Bavailable_currency_codes+__typename%7D%7D&operationName=getStoresAndCurrencies&variables=%7B%7D and inspect the associated headers.
Could you please provide some guidance on how to achieve this? Any help would be greatly appreciated. Thank you for your time and consideration.
Best regards,
acaciusS
skirianov•332d ago
Hey @Acacius have you tried using HTTPToolkit? We generally recommend devs to use it, so that you can intercept requests from middelware to the platform.
Let me know if that helps
A
akie•331d ago
thank you @skirianov , Firstly, I would like to thank you for your swift response and suggestion regarding my previous inquiry. I've tried using HTTPToolkit as per your recommendation, however, it appears this tool primarily captures requests from the browser to Nuxt, which isn't exactly what I'm looking for. Of course it's a very good way to view
I am seeking to inspect the outbound requests from the middleware (the post-request portion), with the ultimate goal of obtaining the logs of the requests received by the backend at the time they are made. This will allow me to accurately modify the code in this portion to fit the needs of my project.
Could you please provide any guidance or point me in the right direction as to how I can accomplish this? Your expertise and insights would be highly appreciated.
Thank you for your time and consideration.💖
S
skirianov•331d ago
Hi @Acacius yes, we use HTTPToolkit for the middleware -> platform communication too. When you start HTTPToolkit it allows you to intercept calls from a particular terminal or port (I guess) so you need to select the terminal where middleware runs. In this case, I would recommend instead of running Nuxt and Middleware from a single command, run them separately in different terminals.
A
akie•331d ago
Thank you very much for your patience to answer, I wish you a happy life
S
skirianov•331d ago
No worries, thank you too ❤️
Let me know if you need anything else
5.2KMembers
View on DiscordWant results from more Discord servers?
More PostsVSF2 product SwatchHello everyone ,
I'm just curious if i can implement product image swatches in product details pagVSF Hosting - deploy on vercelHello everyone, did anyone manage to get this deployed to vercel... i am pretty close... the build wFetch .env variables in .vue filesHello everyone ,
I am trying to fetch an .env variable in "modules/checkout/components/VsfPaymentPrServer side renderI am using v1 verison of this library, but I found that SfFooter componet does not get rendered on tCustom Integration Boilerplate - Where is functionality?Hi,
we're implementing a complete custom integration with backend, api, theme etc 🙂
i'm curios hoSfComponentSelect dosen't hold selectionHi there,
i have problem with SfComponentSelect component
```
<SfComponentSelect
SFUI 2.x with Magento 2How can i use SFUI 2.x with Magento 2.
Want to test SFUI 2.x on my local machine to see its performaVSF2 + OpenMageGreetings 🙂
I have a question regarding the integration of Vue-Storefront 2 with Magento 1.9 (OpenHi AllI am trying to implement Payment gateway in vsf ,But I cannot find the yarn or npm package mentioneBasic AuthHi all. I have a question regarding authentication. On our prod instance everything works fine. But "Accept all cookies"I am using shopware-pwa with Shopware 6 and I'm trying to expose an Accept all cookies button. The sFollowing Digitalocean deploy tutorial leads to errorHello! I'm following this step-by-step tutorial
https://vuestorefront.io/blog/step-by-step-guide-de