npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-ember-cli-deploy-azure-tables

v0.3.0

Published

An ExpressJS middleware to serve EmberJS apps deployed by ember-cli-deploy and using Azure Table Storage

Downloads

18

Readme

node-ember-cli-deploy-azure-tables

ExpressJS middleware to fetch the current (or specified) revision of your Ember App from Azure Tables deployed by ember-cli-deploy.

Why?

ember-cli-deploy is great. It allows you to run multiple versions in production at the same time and view revisions without impacting users. However, the example provided uses koa and many of us are not. This package allows you to easily fetch current and specified index.html revisions from Azure Table storage.

Deploying to Azure via Ember CLI

Check out the excellent ember-cli-deploy-azure addon by duizendnegen!

Installation

npm install node-ember-cli-deploy-azure-tables

Usage

There are two ways of using the package:

ExpressJS Middleware

  1. require the package
  2. use the package in your app

Example

var express = require('express');
var app = express();

var nodeEmberCliDeployAzureTables = require('node-ember-cli-deploy-azure-tables');
app.use('/*', nodeEmberCliDeployAzureTables({
  accountName: 'AZURE_STORAGE_ACCOUNT_NAME',
  accessKey: 'AZURE_STORAGE_ACCESS_KEY'
}, 'myapp'));

Fetching a Specific Revision

You can fetch a specific revision by using the index_key query param. Example:

http://www.coolio.com?index_key=abc123

Documentation

nodeEmberCliDeployAzureTables(connectionInfo, keyPrefix, options) (middleware constructor)

  • connectionInfo (object, required) - the configuration to connect to azure tables.
    • accountName (required) - azure storage account name
    • accessKey (required) - azure storage account key
  • keyPrefix (required) - the application name, specified for ember deploy
    the keys in azure tables are prefaced with this name. For instance, if your azure table keys are my-app:index:current, you'd pass my-app:index.
  • options (optional) - a hash of params to override the defaults

options

  • azureTableName (defaults to emberdeploy) overrides the default table name from which to fetch
  • revisionQueryParam (defaults to index_key)
    the query parameter to specify a revision (e.g. http://example.org/?index_key=abc123). the key will be automatically prefaced with your keyPrefix for security.
  • memoize (defaults to false) enable memoizing azure storage. see the memoization section for more details.
  • memoizeOpts customize memoization parameters. see the memoization section for more details.

Memoization

Since the majority of the requests will be serving the current version of your app, you can enable memoization to reduce the load on Azure Tables. By default, memoization is disabled. To enable it, simply pass:

memoize: true

in your options hash. Additionally, you can pass options to the underlying memoization library (memoizee). Check out their documentation, and the defaults for this library.

Example

app.use('/*', nodeEmberCliDeployAzureTables({
  accountName: 'AZURE_STORAGE_ACCOUNT_NAME',
  accessKey: 'AZURE_STORAGE_ACCESS_KEY'
  },
  'myapp',
  { memoize: true },
));

Credit

This is a modified version of Ben Limmer's excellent node-ember-cli-deploy-redis package. Thanks, Ben!

Contributing

Comments/PRs/Issues are welcome!