Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions starters/angular/basic/apphosting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Settings for Backend (on Cloud Run).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have a header explaining the use of environment-specific apphosting.yaml overrides?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd rather point the users to public doc so we don't have 2 separate places to track documentations on how to use env specific overrides.

# See https://firebase.google.com/docs/app-hosting/configure#cloud-run.
runConfig:
minInstances: 0
# maxInstances: 100
# concurrency: 80
# cpu: 1
# memoryMiB: 512

# Environment variables and secrets.
# env:
# Configure environment variables.
# See https://firebase.google.com/docs/app-hosting/configure#user-defined-environment.
# - variable: MESSAGE
# value: Hello world!
# availability:
# - BUILD
# - RUNTIME

# Configure secrets
# See https://firebase.google.com/docs/app-hosting/configure#secret-parameters
# - variable: API_KEY
# secret: myApiKeySecret
23 changes: 23 additions & 0 deletions starters/nextjs/basic/apphosting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Settings for Backend (on Cloud Run).
# See https://firebase.google.com/docs/app-hosting/configure#cloud-run.
runConfig:
minInstances: 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does Angular comment out all values but Nex.tjs does not?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you use the variable in Next.js, but then why not use it in Angular SSR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea how to use env vars in angular. If you do, welcoming a PR!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process.env doesn't work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

# maxInstances: 100
# concurrency: 80
# cpu: 1
# memoryMiB: 512

# Environment variables and secrets.
env:
# Configure environment variables.
# See https://firebase.google.com/docs/app-hosting/configure#user-defined-environment.
- variable: MESSAGE
value: Hello world!
availability:
- BUILD
- RUNTIME

# Configure secrets
# See https://firebase.google.com/docs/app-hosting/configure#secret-parameters
# - variable: API_KEY
# secret: myApiKeySecret
2 changes: 2 additions & 0 deletions starters/nextjs/basic/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import Link from "next/link";

export default function Home() {
const message = process.env["MESSAGE"] || "Hello!";
return (
<main className="content">
<h1 className="heading">Next.js on Firebase App Hosting</h1>
<p>{message}</p>

<section className="features">
<article className="card">
Expand Down