fastboot-express-middleware
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -0,1 +1,10 @@ | ||
## v3.1.0 (2020-11-20) | ||
#### :rocket: Enhancement | ||
* [#66](https://github.com/ember-fastboot/fastboot-express-middleware/pull/66) Add support for passing metadata into visitOptions of fastboot visit ([@suchitadoshi1987](https://github.com/suchitadoshi1987)) | ||
#### Committers: 1 | ||
- Suchita Doshi ([@suchitadoshi1987](https://github.com/suchitadoshi1987)) | ||
## v3.0.0 (2020-10-23) | ||
@@ -2,0 +11,0 @@ |
{ | ||
"name": "fastboot-express-middleware", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "An Express middleware for rendering Ember apps with FastBoot", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -110,4 +110,21 @@ # FastBoot Express Middleware | ||
## VisitOptions | ||
For sending over additional metadata so that it could be leveraged by the consuming app/addon, you can pass the `visitOptions` option that contains any extra information that might be necessary. | ||
Example usecase: If an addon relies on some metadata that is set by the consuming app, then in that case the addon will not have the access to the metadata value. In such cases, developing against dummy app becomes difficult. Hence, passing in the `visitOptions` will enable smoother local addon development. | ||
```js | ||
app.get('/*', fastbootMiddleware({ | ||
distPath: '/path/to/dist', | ||
visitOptions: { | ||
metadata: { | ||
foo: 'bar' | ||
} | ||
} | ||
})); | ||
``` | ||
## Tests | ||
`npm test` |
@@ -32,3 +32,4 @@ 'use strict'; | ||
try { | ||
let result = await fastboot.visit(path, { request: req, response: res }); | ||
let visitOptions = Object.assign({}, opts.visitOptions, { request: req, response: res }); | ||
let result = await fastboot.visit(path, visitOptions); | ||
let body = opts.chunkedResponse ? await result.chunks() : await result.html(); | ||
@@ -35,0 +36,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13431
67
130