We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57c3d01 commit 3dd11acCopy full SHA for 3dd11ac
netlify/edge-functions/shorten.ts
@@ -2,6 +2,7 @@ import { multiParser } from "https://deno.land/x/multiparser@0.114.0/mod.ts";
2
import { headers } from "./headers.ts";
3
import handler from "./utils.ts";
4
5
+const urlBase = Deno.env.get("URL_BASE") ? Deno.env.get("URL_BASE") : "";
6
const { fetchFromSupabase, generateShortUrl } = handler();
7
8
export default async (request: Request): Promise<Response> => {
@@ -16,7 +17,9 @@ export default async (request: Request): Promise<Response> => {
16
17
});
18
}
19
- const shortUrl = generateShortUrl();
20
+ let shortUrl = generateShortUrl();
21
+ shortUrl = urlBase + shortUrl;
22
+
23
await fetchFromSupabase("urls", {
24
method: "POST",
25
headers: { "Content-Type": "application/json" },
0 commit comments