You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-7Lines changed: 19 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,14 @@ FastBoot requires Node.js v4 or later.
23
23
constFastBoot=require('fastboot');
24
24
25
25
let app =newFastBoot({
26
-
distPath:'path/to/dist'
26
+
distPath:'path/to/dist',
27
+
// optional boolean flag when set to true does not reject the promise if there are rendering errors (defaults to false)
28
+
resilient:<boolean>,
29
+
sandbox:'path/to/sandbox/class', // optional sandbox class (defaults to vm-sandbox)
30
+
sandboxGlobals: {...} // optional map of key value pairs to expose in the sandbox
27
31
});
28
32
29
-
app.visit('/photos')
33
+
app.visit('/photos', options)
30
34
.then(result=>result.html())
31
35
.then(html=>res.send(html));
32
36
```
@@ -35,6 +39,18 @@ In order to get a `dist` directory, you will first need to build your
35
39
Ember application, which packages it up for using in both the browser
36
40
and in Node.js.
37
41
42
+
### Additional configuration
43
+
44
+
`app.visit` takes a second parameter as `options` above which a map and allows to define additional optional per request
45
+
configuration:
46
+
47
+
-`resilient`: whether to reject the returned promise if there is an error during rendering. If not defined, defaults to the app's resilient setting.
48
+
-`html`: the HTML document to insert the rendered app into. Uses the built app's index.html by default.
49
+
-`metadata`: per request meta data that is exposed in the app via the [fastboot service](https://github.com/ember-fastboot/ember-cli-fastboot/blob/master/app/services/fastboot.js).
50
+
-`shouldRender`: boolean to indicate whether the app should do rendering or not. If set to false, it puts the app in routing-only. Defaults to true.
51
+
-`disableShoebox`: boolean to indicate whether we should send the API data in the shoebox. If set to false, it will not send the API data used for rendering the app on server side in the index.html. Defaults to false.
52
+
-`destroyAppInstanceInMs`: whether to destroy the instance in the given number of ms. This is a failure mechanism to not wedge the Node process
53
+
38
54
### Build Your App
39
55
40
56
To get your Ember.js application ready to both run in your user's
@@ -57,11 +73,7 @@ server.
57
73
### Command Line
58
74
59
75
You can start a simple HTTP server that responds to incoming requests by
60
-
rendering your Ember.js application using the `ember-fastboot` command:
61
-
62
-
```
63
-
$ ember-fastboot path/to/dist --port 80
64
-
```
76
+
rendering your Ember.js application using the [FastBoot App Server](https://github.com/ember-fastboot/fastboot-app-server#ember-fastboot-app-server)
0 commit comments