Simple Serverless Secure Storage
gsutil cors set firebase-config/cors_setting.json gs://cloud-storage-id
gsutil cors get gs://cloud-storage-id
gsutil lifecycle set firebase-config/lifecycle.json gs://cloud-storage-id
gsutil lifecycle get gs://cloud-storage-id
firebase deploy --only functions
npm run build
gcloud app deploy app.yaml --project project-id
This example includes Firebase authentication and serverless API routes.
Execute create-next-app
with Yarn or npx to bootstrap the example:
npx create-next-app --example with-firebase-authentication with-firebase-authentication-app
# or
yarn create next-app --example with-firebase-authentication with-firebase-authentication-app
Set up Firebase:
.env.local.example
into a new file called .env.local
project_id
, client_email
and client_id
. Set them as environment variables in the .env.local
file at the root of this project.apiKey
, authDomain
and databaseUrl
. Set the appropriate environment variables in the .env.local
file at the root of this project.Install it and run:
npm install
npm run dev
# or
yarn
yarn dev
Deploy it to the cloud with Vercel (Documentation).
After deploying, copy the deployment URL and navigate to your Firebase project's Authentication tab. Scroll down in the page to "Authorized domains" and add that URL to the list.