Fetching Meta Data (title and description etc.) from an api before page serve - SSR #9520
-
Hi guys, I am using quasar for building apps since November 2020, and I must say, it's amazing and super wonderful! I now tried to give it a try to build an SSR website. And am stuck badly here: I understand this might come off as a total noob question, but no matter what I do, for the life of me, I can not figure out how to fetch the metadata from a backend API and set it using createMetaMixin (Quasar v2). No matter whatever I do, the remote API is always fetched after the page has been rendered and sent to the client, so meta tags are set after page render. I am using Options API. Can someone please help me out with this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
For the global API requests you may use a boot files, as they allow you to use async/await. |
Beta Was this translation helpful? Give feedback.
For the global API requests you may use a boot files, as they allow you to use async/await.
For the specific pages there is a special method named preFetch which is called everytime router uses the page in the backend.