Capítulo 545 de 988

Chapter 545: getSites()

Core Idea

<ExperimentalBadge> <p> Cloud Run is in <a href="/docs/cloudrun/status">Alpha status and not actively being developed.

Key Concepts

  • Example
  • Arguments
  • region
  • Return value
  • sites
  • id
  • bucketName
  • bucketRegion

Code Examples

const {sites, buckets} = await getSites('europe-west4');

for (const site of sites) {
  console.log(site.id); // A unique ID for referring to that project
  console.log(site.bucketName); // In which bucket the site resides in.
  console.log(site.bucketRegion); // In which region the bucket resides in.
  console.log(site.serveUrl); // URL of the deployed site that you can pass to `renderMediaOnCloudRun()`
}

for (const bucket of buckets) {
  console.log(bucket.name); // The name of the Cloud Storage bucket.
  console.log(bucket.creationDate); // A unix timestamp of when the site was created.
  console.log(bucket.region); // 'europe-west4'
}
  • What it demonstrates: Usage pattern for getSites() from the official docs.

Key Takeaways

  1. Understand example when working with getSites().
  2. Understand arguments when working with getSites().
  3. Understand region when working with getSites().
  4. Understand return value when working with getSites().
  5. Understand sites when working with getSites().

Connects To

  • api: related page in the Cloud Run (@remotion/cloudrun) section.
  • Checklist: related page in the Cloud Run (@remotion/cloudrun) section.
  • cli: related page in the Cloud Run (@remotion/cloudrun) section.