Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-fastboot-server

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-fastboot-server

Production server for running Ember applications using FastBoot

  • 0.7.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51
decreased by-67.92%
Maintainers
2
Weekly downloads
 
Created
Source

Ember FastBoot Server

Build Status

The Ember FastBoot Server is used to render Ember.js applications on the server and deliver them to clients over HTTP. This server is meant to be run in a production environment.

For more information about FastBoot, see www.ember-fastboot.com, the Ember CLI addon that's a prerequisite for developing FastBoot apps.

The FastBoot server requires Node 0.12 or later.

Usage

The FastBoot server supports two modes of usage:

  1. Running as a binary from the command line.
  2. Running programmatically as an Express middleware.

In both cases, you will first need to build your Ember application, which packages it up for using in both the browser and in Node.js.

Build Your App

To get your Ember.js application ready to both run in your user's browsers and run inside the FastBoot environment, run the Ember CLI build command:

$ ember build --environment production

(You will need to have already set up the Ember CLI FastBoot addon. For more information, see the FastBoot quickstart.)

Once this is done, you will have a dist directory that contains the multi-environment build of your app. Upload this file to your FastBoot server.

Command Line

You can start a simple HTTP server that responds to incoming requests by rendering your Ember.js application using the ember-fastboot command:

$ ember-fastboot path/to/dist --port 80

Middleware

Alternatively, you can integrate the FastBoot server into an existing Node.js application by constructing a FastBootServer and using it as a middleware.

var server = new FastBootServer({
  distPath: 'path/to/dist'
});

var app = express();

app.get('/*', server.middleware());

var listener = app.listen(process.env.PORT || 3000, function() {
  var host = listener.address().address;
  var port = listener.address().port;

  console.log('FastBoot running at http://' + host + ":" + port);
});

You can also serve Ember's static assets (compiled JavaScript and CSS files) or public files (like images or fonts) without using a CDN by adding extra routes:

app.use('/assets', express.static('dist/assets'));
app.use('/images', express.static('dist/images'));
app.use('/fonts', express.static('dist/fonts'));
app.get('/*', server.middleware());

Keywords

FAQs

Package last updated on 08 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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