Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Latest commit

 

History

History
47 lines (33 loc) · 958 Bytes

README.md

File metadata and controls

47 lines (33 loc) · 958 Bytes

Short Url on Google Cloud Function

Databse

  1. Enable Cloud Firestore on Google Cloud Function
  2. Connect the project to the Firebase
  3. Add the data to the database, and replace the word in [].
  • Collectons: links
  • Document: [SHORT_NAME]
  • Column:
    • link: [REDIRECT_URL]

Setup Env

echo "PROJECT_ID: $PROJECT_ID" >> .env

Deploy command

cd link
go mod vendor
cd ..
gcloud functions deploy link --source=link --entry-point=Link --runtime=go113 --trigger-http --quiet --env-vars-file .env

Deploy firebase routes

Edit firebase.json

firebase use $PROJECT_ID
firebase deploy --only hosting

Customism Domain Name

  1. Go to Project in Firebase
  2. Select the Hosting
  3. Create a new domain
  • Enter your domain
  • And Redirect your domain to current web site