paypal / react-engine

a composite render engine for universal (isomorphic) express apps to render both plain react views and react-router views
Apache License 2.0
1.45k stars 130 forks source link

Added createOptions scriptLocation #153

Closed JustinMGaiam closed 8 years ago

JustinMGaiam commented 8 years ago

Adding a create option where the script, which contains REACT_ENGINE, can be added to the head of the html. Ideally I would like an option to not automatically render the script tag automatically plus a function to generate the script which allows me to put it where I want in the html component manually, but this works for now.

--- Usage --- const engine = reactEngine.server.create({ routes: require('./routes.jsx'), routesFilePath: './routes.jsx', scriptLocation: 'head', page404: require('./not-found.jsx')) })

vuhwang commented 8 years ago

Would you mind updating the readme Server options spec section? Also could we use scriptLocation instead of scriptLoc?

JustinMGaiam commented 8 years ago

@vuhwang I will get that changed to scriptLocation as well as update the README. Thanks for taking a look.

JustinMGaiam commented 8 years ago

@vuhwang ok the scriptLocation changes have been made

vuhwang commented 8 years ago

thanks @JustinMGaiam. v3.3.0 has been published with this change.