Bird
0
0

Given this Remix loader code running on an edge deployment target:

medium📝 Predict Output Q13 of 15
Remix - Deployment
Given this Remix loader code running on an edge deployment target:
export async function loader() {
  const data = await fetch('https://api.example.com/data');
  return data.json();
}

What is a likely architectural consideration for this deployment?
AThe loader must use local database queries only
BThe loader can run server-side and fetch data directly from the API
CThe loader cannot use async functions on edge
DThe loader must run in the browser and cannot fetch server data
Step-by-Step Solution
Solution:
  1. Step 1: Understand edge deployment context

    Edge deployment runs code close to users but still server-side, so loaders run on the server.
  2. Step 2: Analyze loader data fetching

    The loader can fetch data from external APIs directly because it runs server-side on the edge.
  3. Final Answer:

    The loader can run server-side and fetch data directly from the API -> Option B
  4. Quick Check:

    Edge loader fetches server-side = D [OK]
Quick Trick: Edge runs server-side code, so loaders fetch data directly [OK]
Common Mistakes:
MISTAKES
  • Thinking loaders run in the browser on edge
  • Assuming async is not allowed on edge
  • Believing loaders must use local DB only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Remix Quizzes