Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow reading sandbox and sandboxGlobals from app's config/environment #553

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ember-cli-fastboot changelog

## Unreleased

### Added
* allow reading sandboxGlobals from app's config/environment

## 1.1.0

* Bumping `fastboot-express-middleware` to 1.1.0
* Bumping `fastboot-express-middleware` to 1.1.0
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ module.exports = {
serverMiddleware(options) {
let emberCliVersion = this._getEmberCliVersion();
let app = options.app;
let appConfig = this._getHostAppConfig();

if (emberCliVersion.gte('2.12.0-beta.1')) {
// only run the middleware when ember-cli version for app is above 2.12.0-beta.1 since
Expand All @@ -306,11 +307,12 @@ module.exports = {
if (req.serveUrl && enableFastBootServe) {
// if it is a base page request, then have fastboot serve the base page
if (!this.fastboot) {
// TODO(future): make this configurable for allowing apps to pass sandboxGlobals
// and custom sandbox class
let fastbootConfig = appConfig.fastboot || {};
this.ui.writeLine(chalk.green('App is being served by FastBoot'));
this.fastboot = new FastBoot({
distPath: outputPath
distPath: outputPath,
sandbox: fastbootConfig.sandbox,
sandboxGlobals: fastbootConfig.sandboxGlobals
});
}

Expand Down