File tree Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,69 @@ _This replaces the legacy [url-shortening-api-netlify-supabase](https://github.c
27
27
- ** Netlify Edge Functions** : Serverless functions that run at the edge, closer to your users.
28
28
- ** multiParser** : Parses multipart form data.
29
29
30
+ ### ** Installation**
31
+
32
+ To set up the project locally, follow these steps:
33
+
34
+ 1 . ** Clone the Repository** :
35
+
36
+ ``` bash
37
+ git clone https://github.com/samestrin/url-shortening-api-netlify-edge-supabase.git
38
+ cd url-shortening-api-netlify-edge-supabase
39
+ ```
40
+
41
+ 2 . ** Install Dependencies** : Ensure you have the required dependencies installed. Use npm or yarn to install any necessary packages.
42
+
43
+ ``` bash
44
+ npm install
45
+ ```
46
+
47
+ 3 . ** Set Up Netlify CLI** : Install the Netlify CLI to deploy and test the functions locally.
48
+
49
+ ``` bash
50
+
51
+ npm install -g netlify-cli
52
+ ```
53
+
54
+ 4 . ** Run the Functions Locally** : Use the Netlify CLI to run the edge functions locally.
55
+
56
+ ``` bash
57
+ netlify dev
58
+ ```
59
+
60
+ ### ** Configuration**
61
+
62
+ The ` netlify.toml ` file contains the configuration for the edge functions. Each function is mapped to a specific endpoint:
63
+
64
+ ``` toml
65
+ [build ]
66
+ publish = " public"
67
+
68
+ [build .environment ]
69
+ NODE_VERSION = " 20"
70
+
71
+ [[edge_functions ]]
72
+ path = " /shorten"
73
+ function = " shorten"
74
+
75
+ [[edge_functions ]]
76
+ path = " /count"
77
+ function = " count"
78
+
79
+ [[edge_functions ]]
80
+ path = " /latest"
81
+ function = " latest"
82
+
83
+ [[edge_functions ]]
84
+ path = " /version"
85
+ function = " version"
86
+
87
+ [[edge_functions ]]
88
+ path = " /*"
89
+ function = " redirect"
90
+
91
+ ```
92
+
30
93
## Endpoints
31
94
32
95
### Shorten URL
You can’t perform that action at this time.
0 commit comments