fastboot-s3-downloader

0.2.2 • Public • Published

FastBoot S3 Downloader

This downloader for the FastBoot App Server works with AWS S3 to download and unzip the latest version of your deployed application.

To use the downloader, configure it with an S3 bucket and key:

let downloader = new S3Downloader({
  bucket: S3_BUCKET,
  key: S3_KEY,
  accessKeyId: AWS_KEY, // optional
  secretAccessKey: AWS_SECRET, // optional
  region: AWS_REGION // optional
});
 
let server = new FastBootAppServer({
  downloader: downloader
});

When the downloader runs, it will download the file at the specified bucket and key. That file should be a JSON file that points at the real application, and looks like this:

{
  "bucket": "S3_BUCKET",
  "key": "path/to/dist.zip"
}

Once downloaded, this file is parsed to find the location of the actual app bundle, which should be a zip file somewhere else on S3.

Why this layer of indirection? By configuring the app server to look in a static location on S3, you don't need to propagate config changes to all of your app servers when you deploy a new version. Instead, they can just grab a fixed file to determine the current version.

If you like this, you may also be interested in the companion fastboot-s3-notifier.

Package Sidebar

Install

npm i fastboot-s3-downloader

Weekly Downloads

154

Version

0.2.2

License

MIT

Last publish

Collaborators

  • rwjblue
  • tomdale
  • kratiahuja