UNPKG

4.23 kBMarkdownView Raw
1# Faas #
2
3Faas is a cloud service that provides a blind proxy and secure
4real-time pipeline to reach APIs running on sensitive systems behind a
5firewalled network or closed system without requiring any inbound
6ports or web servers to be exposed to the internet.
7
8This npm module provides the libraries needed to serve an API from a
9client system.
10
11## Installation & Setup ##
12
13### Quick-Start Demo: Node.js ###
14
151. In your project directory, install the faas library:
16
17 npm install faas
18
192. Generate a simple demo startup script and API files:
20
21 ./node_modules/faas/demos/node/generate.sh
22
23 # OR `npm root`/faas/demos/node/generate.sh
24
25 This creates the file `./faas_demo_start.sh` and the `faas_demo_apis` directory.
26
273. Start your API server:
28
29 ./faas_demo_start.sh
30
314. Open a browser to [https://api.faas.io/demo](https://api.faas.io/demo)
32and watch your API server in action!
33
34
35### Quick-Start Demo: Java ###
36
371. In your project directory, install the faas library:
38
39 npm install faas
40
412. Generate a simple demo startup script and API files:
42
43 ./node_modules/faas/demos/java/generate.sh
44
45 # OR `npm root`/faas/demos/java/generate.sh
46
47 This creates the file `./faas_demo_start.sh`, and the `faas_demo_apis` directory.
48
493. Start your API server:
50
51 ./faas_demo_start.sh
52
534. Open a browser to [https://api.faas.io/demo](https://api.faas.io/demo)
54and watch your API server in action!
55
56
57### Quick-Start Demo: Ruby ###
58
591. In your project directory, install the faas library:
60
61 npm install faas
62
632. Generate a simple demo startup script and API files:
64
65 ./node_modules/faas/demos/ruby/generate.sh
66
67 # OR `npm root`/faas/demos/ruby/generate.sh
68
69 This creates the file `./faas_demo_start.sh`, and the `faas_demo_apis` directory.
70
713. Start your API server:
72
73 ./faas_demo_start.sh
74
754. Open a browser to [https://api.faas.io/demo](https://api.faas.io/demo)
76and watch your API server in action!
77
78
79### Quick-Start Demo: HTTP Proxy ###
80
811. In your project directory, install the faas library:
82
83 npm install faas
84
852. Generate a simple demo startup script and API files:
86
87 ./node_modules/faas/demos/http-proxy/generate.sh
88
89 # OR `npm root`/faas/demos/http-proxy/generate.sh
90
91 This creates the file `./faas_demo_start.sh`, and the `./app.js` demo app.
92
933. Start your API server:
94
95 ./faas_demo_start.sh
96
974. Open a browser to your demo url (https://faasdemo-XXXXXXXX.http-proxy.faas.io/) and watch your proxy in action!
98
99--------------------------------------------------------------------
100
101## Intel Edison ##
102
103### Edison Quick-Start & Demo ###
104
1051. Configure your Edison to
106[connect to your WiFi network](http://www.intel.com/support/edison/sb/CS-035342.htm).
107
1082. Install faas from a terminal on your Edison:
109
110 npm install faas
111
1123. Generate a simple demo startup script and API files:
113
114 ./node_modules/faas/demos/edison/generate.sh
115
116 # OR `npm root`/faas/demos/edison/generate.sh
117
118 This creates the file `./faas_demo_start.sh` and the `faas_demo_apis` directory.
119
1204. Start the API on your Edison by running:
121
122 ./faas_demo_start.sh
123
1245. Open a browser to [https://api.faas.io/demo](https://api.faas.io/demo)
125and enter your device key.
126You should now be able to turn the LED on your board on and off.
127That's it!
128
129 Tip: The "DEVICE KEY" was printed to your screen when you
130started the command in Step 3. This is your Edison serial number,
131which can also be found on a physical label on your Edison, or
132in the file /factory/serial_number.
133
134
135### Extra Credit: Start on boot and restart on error ###
136
137To enable your API to start whenever you boot your Edison
138(without needing to log in to it), you can run the following:
139
140 ./node_modules/faas/demos/edison/install_service.sh
141
142This does a few things:
143
1441. Copies the demo apis to `/home/root/faas_api`.
145
1462. Installs faas there (`npm install faas`).
147
1483. Creates a script to run your api at `/home/root/faas_api/run_faas_api.sh`.
149
1504. Creates a systemd service file to point to your script at
151`/lib/systemd/system/faas.service`.
152
1535. Enables this service to start automatically on boot via
154`systemctl enable faas`.
155
156
157
158---
159For more info, go to [faas.io](http://www.faas.io)