fujiokayu / S4

simple serverless secure storage
MIT License
1 stars 0 forks source link
firebase firebase-authentication serverless

S4

Simple Serverless Secure Storage

set CORS

gsutil cors set firebase-config/cors_setting.json gs://cloud-storage-id
gsutil cors get gs://cloud-storage-id

set lifecycle

gsutil lifecycle set firebase-config/lifecycle.json gs://cloud-storage-id
gsutil lifecycle get gs://cloud-storage-id

deploy(Cloud Function)

firebase deploy --only functions

deploy(Google App Engine)

npm run build
gcloud app deploy app.yaml --project project-id

Example: Firebase authentication with a serverless API

This example includes Firebase authentication and serverless API routes.

How to use

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

Configuration

Set up Firebase:

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.