Search code examples
sproutcore

How do I deploy sproutcore using a CDN into an existing site?


I'm just learning about SproutCore now, seems great. But I can't find a good answer on deployment options.

I'm starting small. Just implementing a single page of a complex site with SproutCore. Right now, that page is dynamically generated and served from my django based server. I serve all of my static files (.js, .css, images, etc) off of a CDN.

The page represents one customer.

So, on that dynamic page, it knows:

  1. What customer we should be looking at, the ID, name, etc.
  2. Where my media should be loaded from (absolute HTTP path)

How do I get a SproutCore based app to deploy and run in an environment like this?

I imagine I can upload the built sproutcore app to my CDN. Then in my html page, somehow reference it. But how does that SproutCore app know what server to request backend data from (I'd rather not hard code it)? It can't be installed in the root of the CDN, so how does it know how to load things relative to itself? I could tell it an absolute URL to load from at run time. With some pain, I could even tell it an absolute URL to load from at build time.


Solution

  • No answers on this one, here's what I did...

    Ended up moving to Ember.js (aka SproutCore 2). That follows a completely normal "add .js to a page and serve it normally" model and doesn't have any interesting deployment worries, so it's a no-brainer.