Skip to content

Commit 40b6634

Browse files
committed
Add FastBoot configuration section into README
1 parent 1f6c8c2 commit 40b6634

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,40 @@ visit your app at `http://localhost:4200/?fastboot=false`. If you want to turn o
6060

6161
You can even disable serving fastboot with `ember serve` using an environment flag: `FASTBOOT_DISABLED=true ember serve`. If you have disabled building fastboot assets using the same flag as described [here](https://github.com/ember-fastboot/ember-cli-fastboot#double-build-times-and-no-incremental-builds), remember to also disable serving fastboot assets when using `ember serve`.
6262

63+
### FastBoot Configuration
64+
65+
When running locally using `ember serve` you can pass options into FastBoot instance via `config/fastboot.js` file. The configuration file is applicable only for applications, addons are not supported.
66+
67+
```js
68+
module.exports = function(environment) {
69+
let myGlobal = environment === 'production' ? process.env.MY_GLOBAL : 'testing';
70+
71+
return {
72+
sandboxGlobals: {
73+
myGlobal;
74+
}
75+
};
76+
}
77+
```
78+
79+
There are several options available, see FastBoot's [README](https://github.com/ember-fastboot/fastboot/tree/v2.0.3#usage) for more information, but be aware that `distPath` is provided internally by `ember-cli-fastboot`, hence it can not be modified by this file.
80+
81+
### FastBoot App Server Configuration
82+
83+
When using FastBoot App Server for production environment you have to manually pass options from `config/fastboot.js` file.
84+
85+
```js
86+
const FastBootAppServer = require('fastboot-app-server');
87+
const config = require('./config/fastboot')(process.env.NODE_ENV);
88+
89+
let server = new FastBootAppServer({
90+
distPath: 'dist',
91+
...config,
92+
});
93+
94+
server.start();
95+
```
96+
6397
## Using Node/npm Dependencies
6498

6599
### Whitelisting Packages

0 commit comments

Comments
 (0)