Skip to content

Commit aefaae7

Browse files
authored
Add basic apphosting.yaml in next.js and angular starter templates. (#255)
* Add basic apphosting.yaml in next.js and angular starter templates. * Use default values as example.
1 parent 837f67b commit aefaae7

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Settings for Backend (on Cloud Run).
2+
# See https://firebase.google.com/docs/app-hosting/configure#cloud-run.
3+
runConfig:
4+
minInstances: 0
5+
# maxInstances: 100
6+
# concurrency: 80
7+
# cpu: 1
8+
# memoryMiB: 512
9+
10+
# Environment variables and secrets.
11+
# env:
12+
# Configure environment variables.
13+
# See https://firebase.google.com/docs/app-hosting/configure#user-defined-environment.
14+
# - variable: MESSAGE
15+
# value: Hello world!
16+
# availability:
17+
# - BUILD
18+
# - RUNTIME
19+
20+
# Configure secrets
21+
# See https://firebase.google.com/docs/app-hosting/configure#secret-parameters
22+
# - variable: API_KEY
23+
# secret: myApiKeySecret

starters/nextjs/basic/apphosting.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Settings for Backend (on Cloud Run).
2+
# See https://firebase.google.com/docs/app-hosting/configure#cloud-run.
3+
runConfig:
4+
minInstances: 0
5+
# maxInstances: 100
6+
# concurrency: 80
7+
# cpu: 1
8+
# memoryMiB: 512
9+
10+
# Environment variables and secrets.
11+
env:
12+
# Configure environment variables.
13+
# See https://firebase.google.com/docs/app-hosting/configure#user-defined-environment.
14+
- variable: MESSAGE
15+
value: Hello world!
16+
availability:
17+
- BUILD
18+
- RUNTIME
19+
20+
# Configure secrets
21+
# See https://firebase.google.com/docs/app-hosting/configure#secret-parameters
22+
# - variable: API_KEY
23+
# secret: myApiKeySecret

starters/nextjs/basic/src/app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import Link from "next/link";
22

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

810
<section className="features">
911
<article className="card">

0 commit comments

Comments
 (0)