N
Nuxt7mo ago
sinewy

Load from API when server starts

Hi all. I am quite new to all this nuxt thing and currently I am working on an app. I got it working and all but now I need this feature where I have certain data, like some API base urls, and ports and other stuff that I get from, let's say configApi. So as I see it, it would make sense to call this api once the server starts up, get all this data from api and save it for later use in the app, so that is always there. I will need this data in server routes and in components or composables. I managed to find how to run stuff on server start. I made a plugin in ./server/plugins/server-start.ts But how to store this data and where. What would be the best approach to do this? Thanks for pointer and info.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server