Skip to content

root27/serverless-redirector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless URL Redirector

This is simple redirector service that can redirect a set of URL's in Google Sheets. You need to define Google Sheets as shown below and deploy to Google Cloud

Shortpath Redirect
gh https://github.com/root27
lin https://linkedin.com/in/ogzdo
ex https://docs.google.com/spreadsheets/d/14lESvPQuXoJfSHLk_gKs4FLYpW1vmWrtw8UbOw5CfmM/edit?usp=sharing

How to Setup

  1. Create new Google Sheet

  2. Set URL's of your desired shorpaths (see example)

  3. Save ID of the your google sheet (example: 14lESvPQuXoJfSHLk_gKs4FLYpW1vmWrtw8UbOw5CfmM)

  4. Click below button to deploy application to Cloud Run and provide sheet ID during deployment;

    Run on Google Cloud

  5. Go to Cloud Console and click on sheet-redirector service. Copy the email address in Service accountsection.

  6. Back to your Google Sheets and share it with this email address as "Viewer" access.

  7. Enable the Google Sheets API in here

Domain Mapping

This is an optional step. If you want to use custom domain as go.root27.dev, go to domains and map sheet-redirector service to your domain.

Variable Config

You can configure several parameters in this service. The parameters are;

Env. Variable Description
SHEETNAME(optional) If you want to manage multiple Google Sheets, you can provide Sheet name
TTL (optional) You can set time how frequently the sheet must be queried (default: 5 seconds)
PORT (optional) Server port to listen (default: 8000)