MENU

Fun & Interesting

Fetch ONCE and share data between Nuxt and Nitro!

Alexander Lichter 2,753 1 week ago
Video Not Working? Fix It Now

When building your whole application with Nuxt and using Nitro's backend capabilities (or as BFF with an external API), sometimes you want to share data between both parts - ideally without fetching them again. Impossible? Not at all! This video shows how. --- Links and Resources ? Nitro docs https://nitro.build/ --- Chaptermarks 00:00 Intro 00:14 Sharing data can be necessary 01:09 Demo App Setup 01:33 Setting up what we want to share 04:34 Attaching the info to the event context 05:21 Augmenting the Event Context for TypeScript 07:55 Sharing the data with the Nuxt part of our app 13:10 Verifying it works 14:00 Wrapping up --- Links marked with * are affiliate links. I get a small commission when you register for the service or buy the product through my link. This helps me keeping the channel running. I only include affiliate links for services or product mentioned that we use ourselves or have good experience with.

Comment