Skip to content
Prev Previous commit
Prepend URLSHORT_ to Env variables
  • Loading branch information
samestrin committed May 14, 2024
commit 4e1d3141d4b2f49c28f9a8abd2ea668423ec960c
3 changes: 2 additions & 1 deletion netlify/edge-functions/redirect.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import handler from "./utils.ts";
const { fetchFromSupabase, logClick, validateIpAddress } = handler();
const trackClicks = Deno.env.get("TRACK_CLICKS") || false;

const trackClicks = Deno.env.get("URLSHORT_TRACK_CLICKS") || false;
/**
* Handles redirection for shortened URLs, logs the click, IP address, and hostname.
*
Expand Down
3 changes: 2 additions & 1 deletion netlify/edge-functions/shorten.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { isURL } from "https://deno.land/x/is_url/mod.ts";

import { headers } from "./headers.ts";
import handler from "./utils.ts";
const urlBase = Deno.env.get("URL_BASE") || "";
const { generateShortUrl } = handler();

const urlBase = Deno.env.get("URLSHORT_URL_BASE") || "";

/**
* Shortens a given long URL and stores it in Supabase.
*
Expand Down