Registry / devops / fastboot-app-server

fastboot-app-server

JSON →
library4.1.4jsnpmunverified

fastboot-app-server is a dedicated application server designed for deploying and running Ember FastBoot applications in production environments. It provides robust capabilities for managing the lifecycle of an Ember app, including downloading new builds, automatically scaling across CPU cores using Node.js clustering, and seamlessly detecting and hot-reloading new application versions without downtime. The current stable version is 4.1.4. The project maintains a steady release cadence with frequent patch updates and less frequent major versions, with v4.0.0 released in early 2024. Key differentiators include its built-in extensibility, allowing developers to customize how app builds are downloaded (Downloader), how new versions are detected (Notifier), and even swap out the underlying HTTP server implementation (e.g., using Express) to integrate custom middleware or routing. It aims to simplify the operational aspects of server-side rendering Ember applications.

npm install fastboot-app-server
INSTALL
IMPORT
SIG · FASTBOOT-APP-SERVE
F
fastboot-app-server
devopsjavascriptv4.1.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FastBootAppServer
const FastBootAppServer = require('fastboot-app-server');
import { FastBootAppServer } from 'fastboot-app-server';
The primary entry point for the FastBoot App Server. Examples consistently use CommonJS `require()`.
ExpressHTTPServer
const ExpressHTTPServer = require('fastboot-app-server/src/express-http-server');
Used for customizing the underlying HTTP server with Express. Note the explicit path to `src/`.
MyCustomExpressServer (example)
class MyCustomExpressServer extends ExpressHTTPServer { /* ... */ }
import { MyCustomExpressServer } from 'my-custom-express-server';
Illustrates extending the provided ExpressHTTPServer for advanced customization, not a direct import from the package root.

Demonstrates how to initialize and start a FastBoot App Server with common configuration options such as distPath, gzip, host, port, custom sandbox globals, logging, and chunked responses.

const FastBootAppServer = require('fastboot-app-server'); const MY_GLOBAL = 'MY GLOBAL'; let server = new FastBootAppServer({ distPath: 'dist', gzip: true, // Optional - Enables gzip compression. host: '0.0.0.0', // Optional - Sets the host the server listens on. port: 4000, // Optional - Sets the port the server listens on (defaults to the PORT env var or 3000). buildSandboxGlobals(defaultGlobals) { // Optional - Make values available to the Ember app running in the FastBoot server, e.g. "MY_GLOBAL" will be available as "GLOBAL_VALUE" return Object.assign({}, defaultGlobals, { GLOBAL_VALUE: MY_GLOBAL }); }, log: true, // Optional - Specifies whether the server should use its default request logging. Useful for turning off default logging when providing custom logging middlewares chunkedResponse: true // Optional - Opt-in to chunked transfer encoding, transferring the head, body and potential shoeboxes in separate chunks. Chunked transfer encoding should have a positive effect in particular when the app transfers a lot of data in the shoebox. }); server.start();
Debug
Known issues
breakingFastBoot App Server v4.0.0 and above no longer support Node.js v12. Ensure your production environment uses Node.js v14 or later. While the `engines` field in package.json might include Node 12, the official release notes for v4.0.0 explicitly state the removal of Node 12 support.
fix
Upgrade your Node.js runtime to version 14 or higher (e.g., 14.*, >=16) before deploying FastBoot App Server v4+.
affects: >=4.0.0
breakingVersion 4.0.0 removed deprecated implicit injections. Any code relying on these older injection patterns will break.
fix
Review your Ember FastBoot app's code for implicit injections and update them to use explicit injection patterns supported by modern Ember versions. Refer to Ember FastBoot documentation for current best practices on dependency injection.
affects: >=4.0.0
gotchaWhen customizing the HTTP server, the `ExpressHTTPServer` class is imported from `fastboot-app-server/src/express-http-server`. Directly referencing `src` paths can be fragile across minor versions as internal directory structures are not part of the public API and may change.
fix
While currently documented, be aware that future versions might alter the internal path. Consider wrapping this import in your own module or monitoring release notes for changes to this pattern. For complex customizations, extending `FastBootAppServer` itself might be a more stable approach if the `src` path becomes an issue.
affects: >=3.x
gotchaThe `distPath` option must correctly point to the compiled `dist` directory of your Ember application. Misconfiguration will lead to the server being unable to locate and serve your application.
fix
Double-check that the `distPath` value in your server configuration (e.g., `fastboot-server.js`) accurately reflects the absolute or relative path to your Ember app's `dist` folder. Ensure the `dist` folder exists and contains the necessary FastBoot build artifacts.
affects: All
Errors
Common errors & fixes
Error: Cannot find module 'fastboot-app-server'
Attempting to use ES module `import` syntax (`import FastBootAppServer from 'fastboot-app-server'`) in a CommonJS context, or incorrect package installation/path.
fix
Ensure you are using CommonJS `require()` syntax (`const FastBootAppServer = require('fastboot-app-server');`) if your project is not configured for ESM. Also, verify `fastboot-app-server` is correctly installed in your `node_modules`.
TypeError: app.buildSandboxGlobals is not a function
Calling `buildSandboxGlobals` or similar methods on an incorrect object, or passing an invalid type to the server options.
fix
Ensure `buildSandboxGlobals` is passed as an option during the `FastBootAppServer` constructor, not called directly. It should be a function that receives `defaultGlobals` and returns an object of additional globals.
Error: EMFILE: too many open files, watch
Node.js file watcher limit reached, often due to many files in the `distPath` or multiple workers monitoring the same directory.
fix
Increase your system's `fs.inotify.max_user_watches` limit (Linux) or `kern.maxfiles` (macOS). Alternatively, for very large apps or complex deployments, consider disabling the server's default file watching mechanism if you have an external build deployment strategy.
Upgrade
Version history
4.1.4latest on npm
Audit
Dependencies
noderequiredRuntime environment for the server. Specific versions are required, with older versions deprecated in major releases.
fastbootrequiredCore FastBoot engine for rendering Ember apps, a peer dependency managed internally.
Agent activity
10 hits · last 30 days
node
8
Resources