This repository was archived by the owner on Oct 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,10 @@ If you are not using NPM/Webpack then you will need to bring in Hyperloop-JS in
102
102
<script src =" https://unpkg.com/react-router/umd/react-router.min.js" ></script >
103
103
104
104
<!-- Opal (or bring your own) -->
105
- <script src =" http ://cdn.opalrb.org/opal/current /opal.min.js" ></script >
105
+ <script src =" https ://rawgit.com/ruby-hyperloop/hyperloop-js/master/dist /opal.min.js" ></script >
106
106
107
107
<!-- Hyperloop-js -->
108
- <script src =" https://rawgit.com/ruby-hyperloop/hyperloop-js/edge /dist/hyperloop.min.js" ></script >
108
+ <script src =" https://rawgit.com/ruby-hyperloop/hyperloop-js/master /dist/hyperloop.min.js" ></script >
109
109
</head >
110
110
```
111
111
@@ -128,7 +128,7 @@ Or add the following to your HTML page:
128
128
``` html
129
129
<head >
130
130
<!-- Hyperloop-compiler (only needed if you are doing in browser compiling) -->
131
- <script src =" https://rawgit.com/ruby-hyperloop/hyperloop-js/refactor /dist/hyperloop-compiler.min.js" ></script >
131
+ <script src =" https://rawgit.com/ruby-hyperloop/hyperloop-js/master /dist/hyperloop-compiler.min.js" ></script >
132
132
</head >
133
133
```
134
134
Original file line number Diff line number Diff line change 15
15
<!-- <script src="https://unpkg.com/react-router-dom/umd/react-router-dom.min.js"></script> -->
16
16
17
17
<!-- Opal (or bring your own) -->
18
- < script src ="http ://cdn.opalrb.org/opal/current /opal.min.js "> </ script >
18
+ < script src ="https ://rawgit.com/ruby-hyperloop/hyperloop-js/master/dist /opal.min.js "> </ script >
19
19
20
20
<!-- Opal and Hyperloop -->
21
21
<!-- <script src="opal.min.js"></script> -->
22
- < script src ="hyperloop.min.js "> </ script >
23
- < script src ="hyperloop-compiler.min.js "> </ script >
22
+ < script src ="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/dist/ hyperloop.min.js "> </ script >
23
+ < script src ="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/dist/ hyperloop-compiler.min.js "> </ script >
24
24
25
25
< link href ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css " rel ="stylesheet " integrity ="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u " crossorigin ="anonymous ">
26
26
34
34
Buttons ( )
35
35
Clock ( )
36
36
StylishTable ( )
37
+ FaaS ( )
37
38
end
38
39
end
39
40
end
104
105
end
105
106
end
106
107
108
+ class FaaS < Hyperloop ::Component
109
+ render ( DIV ) do
110
+ BUTTON { 'faastruby.io' } . on ( :click ) do
111
+ faast_ruby
112
+ end
113
+ DIV ( class : :block ) do
114
+ P { state . hello [ 'function_response' ] . to_s }
115
+ P { "executed in #{state.hello['execution_time']} ms" }
116
+ end if state . hello
117
+ end
118
+
119
+ def faast_ruby
120
+ HTTP . get ( 'https://api.faastruby.io/paulo/hello-world' ,
121
+ data : { time : true }
122
+ ) do | response |
123
+ # this code executes when the promise resolves
124
+ mutate . hello ( response . json ) if response . ok ?
125
+ end
126
+ end
127
+ end
107
128
</ script >
108
129
109
130
</ head >
You can’t perform that action at this time.
0 commit comments