Setting the file. One moment.
Chapter 03 · Firebase App Hosting Basics
Subchapter 3.3
references/emulation.mdMarkdown1 KBView on GitHub
You can test your App Hosting setup locally using the Firebase Local Emulator Suite. This allows you to verify your app’s behavior with environment variables and secrets before deploying.
apphosting.emulator.yamlThis optional file overrides apphosting.yaml settings specifically for the
local emulator. Use it to provide local secret values or override resource
configs. If it contains sensitive values such as API keys, do not commit it to
source control.
# apphosting.emulator.yaml (gitignored usually)
runConfig:
cpu: 1
memoryMiB: 512
env:
- variable: API_KEY
value: "local-dev-api-key" # Override secret with local valueTo start the App Hosting emulator:
npx -y firebase-tools@latest emulators:start --only apphostingOr, if you are also using other emulators (Auth, Firestore, etc.):
npx -y firebase-tools@latest emulators:startpackage.json to
generate the serving artifact.localhost:5004 (default). Configurable
by setting host and port in the emulators block of firebase.json, like
so:{
"emulators": {
"apphosting": {
"host": "localhost",
"port": 5004
}
}
}apphosting.yaml and
apphosting.emulator.yaml into the process.