Skip to content

Commit 2bdde38

Browse files
committed
Update README with latest fastboot API.
1 parent 030c8e2 commit 2bdde38

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@ FastBoot requires Node.js v4 or later.
2323
const FastBoot = require('fastboot');
2424

2525
let app = new FastBoot({
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
2731
});
2832

29-
app.visit('/photos')
33+
app.visit('/photos', options)
3034
.then(result => result.html())
3135
.then(html => res.send(html));
3236
```
@@ -35,6 +39,18 @@ In order to get a `dist` directory, you will first need to build your
3539
Ember application, which packages it up for using in both the browser
3640
and in Node.js.
3741

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+
3854
### Build Your App
3955

4056
To get your Ember.js application ready to both run in your user's
@@ -57,11 +73,7 @@ server.
5773
### Command Line
5874

5975
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)
6577

6678
### Debugging
6779

0 commit comments

Comments
 (0)