@@ -79,6 +79,8 @@ module.exports = {
7979 this . _appRegistry = app . registry ;
8080 this . _name = app . name ;
8181
82+ this . options = this . _optionsFor ( app . env , app . project ) ;
83+
8284 migrateInitializers ( this . project ) ;
8385 } ,
8486
@@ -323,13 +325,14 @@ module.exports = {
323325 if ( ! this . fastboot ) {
324326 const broccoliHeader = req . headers [ 'x-broccoli' ] ;
325327 const outputPath = broccoliHeader [ 'outputPath' ] ;
328+ const fastbootOptions = Object . assign (
329+ { } ,
330+ this . options ,
331+ { distPath : outputPath }
332+ ) ;
326333
327- // TODO(future): make this configurable for allowing apps to pass sandboxGlobals
328- // and custom sandbox class
329334 this . ui . writeLine ( chalk . green ( 'App is being served by FastBoot' ) ) ;
330- this . fastboot = new FastBoot ( {
331- distPath : outputPath
332- } ) ;
335+ this . fastboot = new FastBoot ( fastbootOptions ) ;
333336 }
334337
335338 let fastbootMiddleware = FastBootExpressMiddleware ( {
@@ -373,8 +376,17 @@ module.exports = {
373376
374377 return checker . for ( 'ember' , 'bower' ) ;
375378 } ,
376-
379+
377380 _isModuleUnification ( ) {
378381 return ( typeof this . project . isModuleUnification === 'function' ) && this . project . isModuleUnification ( ) ;
382+ } ,
383+
384+ _optionsFor ( environment , project ) {
385+ const configPath = path . join ( path . dirname ( project . configPath ( ) ) , 'fastboot.js' ) ;
386+
387+ if ( fs . existsSync ( configPath ) ) {
388+ return require ( configPath ) ( environment ) ;
389+ }
390+ return { } ;
379391 }
380392} ;
0 commit comments