Skip to content

Commit 3dd11ac

Browse files
committed
Update shorten.ts
1 parent 57c3d01 commit 3dd11ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

netlify/edge-functions/shorten.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { multiParser } from "https://deno.land/x/multiparser@0.114.0/mod.ts";
22
import { headers } from "./headers.ts";
33
import handler from "./utils.ts";
44

5+
const urlBase = Deno.env.get("URL_BASE") ? Deno.env.get("URL_BASE") : "";
56
const { fetchFromSupabase, generateShortUrl } = handler();
67

78
export default async (request: Request): Promise<Response> => {
@@ -16,7 +17,9 @@ export default async (request: Request): Promise<Response> => {
1617
});
1718
}
1819

19-
const shortUrl = generateShortUrl();
20+
let shortUrl = generateShortUrl();
21+
shortUrl = urlBase + shortUrl;
22+
2023
await fetchFromSupabase("urls", {
2124
method: "POST",
2225
headers: { "Content-Type": "application/json" },

0 commit comments

Comments
 (0)