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

ember-deploy-rest-index

v0.0.9

Published

An index ember-cli-deploy adapter for REST backends

Downloads

7

Readme

ember-deploy-rest-index

This ember-cli-deploy index adapter uses HTTP REST commands to handle all operations pertaining to the index.html deploy process. The server is, therefore, responsible for managing index.html revisions.

Purpose

This adapter is intended for those who have an existing REST API and would like to leverage it to manage their index.html revisions. It is ideal for internal system environments (not in the cloud) or in the case that adding additional components such as a NoSQL is prohibitive. For such environments, this adapter will enable the usage of the existing infrastructure to accommodate, still, a Lightning Fast Deployments process.

To use

npm install ember-deploy-rest-index

Commands

The adapter implements the following commands as per the ember-cli-deploy interface:

  • deploy - Makes a POST to upload the index.html information:

    Sample Request:

    HTTP POST http://leojh.com/api/ember-revisions
    {
      "id": 'ember-app:9c0568d',
      "indexHtml": '<html>...</html>'
    }

    Sample Response: HTTP 200 OK, 201 CREATED, or 204 NO CONTENT with no content.

  • deploy:list - Makes a GET call to get all uploaded revisions

    Sample Request: HTTP GET https://leojh.com/api/ember-revisions

    Sample Response:

    HTTP OK
    [
      {"id":"ember-app:1bdc67a","createdOn":"2015-06-19T09:58:00-04:00"},
      {"id":"ember-app:2251eda","createdOn":"2015-06-22T10:51:00-04:00"}
      ...
    ]
  • deploy:activate - Makes a PUT call to activate the specified revisions

    Sample Request: HTTP PUT https://leojh.com/api/ember-revisions/ember-app:1bdc67a

    Sample Response: HTTP 200 OK, or 204 NO CONTENT with no content.

Config

Sample config in your deploy.js file:

store: {
  type: 'REST',
  serviceHost: 'http://leojh.com',
  serviceNamespace: 'api',
  serviceIndexVersionResource: 'ember-revisions'
}
  • type - Must be 'REST' to use this adapter
  • serviceHost - the root URL for the service
  • serviceNamespace - path to the service
  • serviceIndexVersionResource - the name of your resource responsible for handling your revisions

The combination of config settings will help construct the target URLs for calling your service. For example, given the config above, the deploy:list command will result in: GET http://leojh.com/api/ember-revisions

Notes

Always specify the environment flag when running any ember deploy commands. Similarly, when specifying a revision to activate, specify the revision flag.

Example: ember deploy:activate --revision ember-app:1234 --environment qa

TODOs:

  1. Authentication header
  2. Cleanup of old revisions
  3. Tests (I know, they should come first)
  4. Multipart?
  5. A REST adapter for assets?