Skip to content

Commit 96eabc8

Browse files
authored
Merge pull request #229 from ember-fastboot/fastboot-dist-path
add Fastboot.distPath
2 parents e461dd8 + e3fe7ae commit 96eabc8

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ In order to get a `dist` directory, you will first need to build your
4141
Ember application, which packages it up for using in both the browser
4242
and in Node.js.
4343

44+
### Default globals
45+
46+
`FastBoot` object will be available to the sandboxed environment. This object has the following form:
47+
48+
```
49+
FastBoot.require // provides a mechanism to load additional modules. Note: these modules are only those included in the module whitelist
50+
FastBoot.config // a function which takes a key, and returns the corresponding fastboot config value
51+
FastBoot.distPath // readOnly accessor that provides the dist path for the current fastboot sandbox
52+
```
53+
4454
### Additional configuration
4555

4656
`app.visit` takes a second parameter as `options` above which a map and allows to define additional optional per request

src/ember-app.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ class EmberApp {
9292
najax,
9393
FastBoot: {
9494
require: sandboxRequire,
95-
config: fastbootConfig
95+
config: fastbootConfig,
96+
get distPath() {
97+
return distPath;
98+
}
9699
}
97100
};
98101

test/fixtures/config-app/assets/fastboot-test.js

Lines changed: 22 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)