Socket
Socket
Sign inDemoInstall

fastboot

Package Overview
Dependencies
Maintainers
6
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastboot - npm Package Compare versions

Comparing version 1.0.0-rc.7 to 1.0.0

22

package.json
{
"name": "fastboot",
"version": "1.0.0-rc.7",
"version": "1.0.0",
"description": "Library for rendering Ember apps in node.js",

@@ -29,19 +29,17 @@ "main": "src/index.js",

"dependencies": {
"chalk": "^0.5.1",
"cookie": "^0.2.3",
"chalk": "^2.0.1",
"cookie": "^0.3.1",
"debug": "^2.1.0",
"exists-sync": "0.0.3",
"express": "^4.13.3",
"express-cluster": "0.0.4",
"minimist": "^1.2.0",
"exists-sync": "0.0.4",
"najax": "^1.0.2",
"rsvp": "^3.0.16",
"simple-dom": "^0.3.0",
"simple-dom": "^1.0.0",
"source-map-support": "^0.4.0"
},
"devDependencies": {
"chai": "^3.5.0",
"chai-as-promised": "^5.2.0",
"fs-promise": "^0.5.0",
"mocha": "^2.4.5",
"chai": "^4.1.0",
"chai-as-promised": "^7.1.1",
"express": "^4.13.3",
"fs-promise": "^2.0.3",
"mocha": "^3.4.2",
"mocha-jshint": "^2.3.1",

@@ -48,0 +46,0 @@ "rimraf": "^2.5.4",

# FastBoot
[![Greenkeeper badge](https://badges.greenkeeper.io/ember-fastboot/fastboot.svg)](https://greenkeeper.io/)
[![npm version](https://badge.fury.io/js/fastboot.svg)](https://badge.fury.io/js/fastboot)
[![Build Status](https://travis-ci.org/ember-fastboot/fastboot.svg?branch=master)](https://travis-ci.org/ember-fastboot/ember-fastboot-server)
![Ember Version](https://embadge.io/v1/badge.svg?start=2.3.0)

@@ -26,6 +28,10 @@ FastBoot is a library for rendering Ember.js applications in Node.js.

let app = new FastBoot({
distPath: 'path/to/dist'
distPath: 'path/to/dist',
// optional boolean flag when set to true does not reject the promise if there are rendering errors (defaults to false)
resilient: <boolean>,
sandbox: 'path/to/sandbox/class', // optional sandbox class (defaults to vm-sandbox)
sandboxGlobals: {...} // optional map of key value pairs to expose in the sandbox
});
app.visit('/photos')
app.visit('/photos', options)
.then(result => result.html())

@@ -39,2 +45,14 @@ .then(html => res.send(html));

### Additional configuration
`app.visit` takes a second parameter as `options` above which a map and allows to define additional optional per request
configuration:
- `resilient`: whether to reject the returned promise if there is an error during rendering. If not defined, defaults to the app's resilient setting.
- `html`: the HTML document to insert the rendered app into. Uses the built app's index.html by default.
- `metadata`: per request meta data that is exposed in the app via the [fastboot service](https://github.com/ember-fastboot/ember-cli-fastboot/blob/master/app/services/fastboot.js).
- `shouldRender`: boolean to indicate whether the app should do rendering or not. If set to false, it puts the app in routing-only. Defaults to true.
- `disableShoebox`: boolean to indicate whether we should send the API data in the shoebox. If set to false, it will not send the API data used for rendering the app on server side in the index.html. Defaults to false.
- `destroyAppInstanceInMs`: whether to destroy the instance in the given number of ms. This is a failure mechanism to not wedge the Node process
### Build Your App

@@ -62,8 +80,4 @@

You can start a simple HTTP server that responds to incoming requests by
rendering your Ember.js application using the `ember-fastboot` command:
rendering your Ember.js application using the [FastBoot App Server](https://github.com/ember-fastboot/fastboot-app-server#ember-fastboot-app-server)
```
$ ember-fastboot path/to/dist --port 80
```
### Debugging

@@ -70,0 +84,0 @@

@@ -240,3 +240,2 @@ 'use strict';

})
.then(() => result.instanceBooted = true)
.then(() => instance.visit(path, bootOptions))

@@ -243,0 +242,0 @@ .then(() => fastbootInfo.deferredPromise)

@@ -10,3 +10,3 @@ 'use strict';

this.protocol = request.protocol;
this.protocol = `${request.protocol}:`;
this.headers = new FastBootHeaders(request.headers);

@@ -13,0 +13,0 @@ this.queryParams = request.query;

@@ -13,3 +13,2 @@ 'use strict';

constructor(options) {
this.instanceBooted = false;
this._instanceDestroyed = false;

@@ -89,3 +88,3 @@ this._doc = options.doc;

_finalizeMetadata(instance) {
if (this.instanceBooted) {
if (instance._booted) {
this.url = instance.getURL();

@@ -92,0 +91,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc