play-co / bundle-server

Reference implementation of the bundle server
0 stars 0 forks source link

Decouple discovery of static content from dynamic content #4

Open yofreke opened 9 years ago

yofreke commented 9 years ago

Seems desirable to have the server declare specific URLs for each available devkit app (/<base>/apps), as well as for versions (/<base>/:app_id) for discovery endpoints, allowing for any static hosting provider to be used.

If the /<base>/:app_id/bundle/* endpoints are crucial, perhaps they can be added to the "optionally implemented" (with more dynamic content like /<base>/:app_id/watch).

jwilm commented 9 years ago

Are they coupled? It seems like the endpoints are pretty generic and can be implemented in static hosting or a dynamic server. The /apps endpoint lets you discover a set of available /:app_id endpoints, and the /:app_id/bundle/* lets you download some version of the app.

There's a capabilities endpoint which I realized now is not documented, but it looks like this:

  app.get('/capabilities', function (req, res) {
    res.json(provider.capabilities);
  });

and the capabilities object has these fields:

function ProviderCapabilities() {
  this.watchable = false;
  this.bundles = false;
  this.getFile = false;
  this.getFileList = false;
}

A dynamic host would probably opt out of the bundles, and the static host would probably opt out of individual files (getFile, getFileList, and watchable).

Is that what you are asking about or am I misunderstanding?

yofreke commented 9 years ago

Currently the static files must be hosted on the same server (or proxied). Would be nice to specify a URL with each app so that you can say something like, "I want to run my server on GAE and I want all my storage on S3."

Right now the idea of a bundle server is coupled to the idea of static content hosting (or proxying), I think the discovery implementation should not make assumptions about where the content is stored

jwilm commented 9 years ago

Why involve a dynamic server at all when your content is all static? The discovery endpoints can just be simple json files (/:app_id, /apps), and when an app changes, the server updates the json files on cloud storage.

I agree about making less assumptions. It should include URLs in either case.