diff --git a/CHANGELOG.md b/CHANGELOG.md index d78fdfd38..af91e3edc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 \ No newline at end of file +* Bumping `fastboot-express-middleware` to 1.1.0 diff --git a/index.js b/index.js index 261b18a59..58550b12f 100644 --- a/index.js +++ b/index.js @@ -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 @@ -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 }); }