File tree 1 file changed +47
-2
lines changed
1 file changed +47
-2
lines changed Original file line number Diff line number Diff line change 1
- # faas-node-url-shortener
2
- A FaaS function to generate a shortened URL via an external service
1
+ # faas-node-ascii
2
+ A [ FaaS] ( http://get-faas.com ) function to generate a shortened URL via an [ external service] ( http://subr.pw )
3
+
4
+ You can execute the function like this:
5
+
6
+ ` curl http://localhost:8080/function/url-shortener -d "2017.dockercon.com" `
7
+
8
+ (or use the FaaS UI to send the URL)
9
+
10
+ ![ ] ( https://pbs.twimg.com/media/C9ljSysVwAAQpxj.jpg )
11
+
12
+ ## Installation
13
+
14
+ You can either install ` faas-node-url-shortener ` via your FaaS compose file or you can add it via the UI.
15
+
16
+ Please note that this function requires internet access to query the external API to shorten the URL.
17
+
18
+ ### Compose file
19
+
20
+ Add this to ` docker-compose.yml ` and then redeploy the stack
21
+
22
+ ``` Dockerfile
23
+ ascii:
24
+ image: developius/faas-node-url-shortener:latest
25
+ labels:
26
+ function: "true"
27
+ depends_on:
28
+ - gateway
29
+ networks:
30
+ - functions
31
+ environment:
32
+ no_proxy: "gateway"
33
+ https_proxy: $https_proxy
34
+ ```
35
+
36
+ ` docker stack deploy -c docker-compose.yml func `
37
+
38
+ ### UI
39
+
40
+ Hit the ` CREATE NEW FUNCTION ` button and add these details:
41
+
42
+ - Image: ` developius/faas-node-url-shortener:latest `
43
+ - Service name: ` ascii `
44
+ - fProcess: ` node /app/index.js `
45
+ - Network: ` func_functions `
46
+
47
+ Hit create!
You can’t perform that action at this time.
0 commit comments