mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-10 12:57:49 +00:00
Added requested changes
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
layout: post
|
layout: post
|
||||||
title: Add a URL shortener function to your application
|
title: Add a URL shortener function to your application
|
||||||
description: Learning how to add the URL shortener function template to your application.
|
description: Learning how to add the URL shortener function template to your application.
|
||||||
cover: /images/blog/adding-url-shortener/Add-a-URL-Shortener-to-your-Application-with-Functions.png
|
cover: /images/blog/adding-url-shortener/cover.png
|
||||||
timeToRead: 5
|
timeToRead: 5
|
||||||
date: 2023-11-08
|
date: 2023-11-08
|
||||||
author: haimantika-mitra
|
author: haimantika-mitra
|
||||||
@@ -21,17 +21,17 @@ You can find the source code on our [templates GitHub repository](https://githu
|
|||||||
# Setting up the Template
|
# Setting up the Template
|
||||||
To get started, you need to navigate to the functions page on the **[Appwrite](https://appwrite.io/cloud)** console. From there, we will select the **Templates** tab, search for and select the **URL Shortener** function template.
|
To get started, you need to navigate to the functions page on the **[Appwrite](https://appwrite.io/cloud)** console. From there, we will select the **Templates** tab, search for and select the **URL Shortener** function template.
|
||||||
|
|
||||||
/images/blog/adding-url-shortener/functions.png
|

|
||||||
|
|
||||||
The function requires two variables:
|
The function requires two variables:
|
||||||
- APPWRITE_API_KEY
|
- `APPWRITE_API_KEY`
|
||||||
- SHORT_BASE_URL
|
- `SHORT_BASE_URL`
|
||||||
|
|
||||||
/images/blog/adding-url-shortener/variables.png
|

|
||||||
|
|
||||||
Once you have populated those, you can go straight to the **Connect** step.
|
Once you have populated those, you can go straight to the **Connect** step.
|
||||||
|
|
||||||
/images/blog/adding-url-shortener/connect.png
|

|
||||||
|
|
||||||
Select **Create a new repository** (this will generate a GitHub repository for you with the function), and leave the production branch and root settings as default to create this function.
|
Select **Create a new repository** (this will generate a GitHub repository for you with the function), and leave the production branch and root settings as default to create this function.
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ Select **Create a new repository** (this will generate a GitHub repository for
|
|||||||
|
|
||||||
Visit the **Domains** tab on the function page and copy the domain URL to test the function.
|
Visit the **Domains** tab on the function page and copy the domain URL to test the function.
|
||||||
|
|
||||||
/images/blog/adding-url-shortener/URL-shortener.png
|

|
||||||
|
|
||||||
Go to the function URL in your web browser, and you'll see a short url like the one shown below.
|
Go to the function URL in your web browser, and you'll see a short url like the one shown below.
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
Reference in New Issue
Block a user