I'm interested in using Ember.js to build a dynamic front-end for an app with a back-end that will essentially be static.
Is there a "best-practices" way to just use a static json file in lieu of a server/database back-end? This is essentially how fixtures work for development, but I'd like to do it for production (ideally loading the external json content directly into the model). Using Ember-CLI to build the app, I figure this content would live in the /public folder.
Ideally this data would be generated by something like Jekyll or Middleman (where a static site generator can loop through a collection of posts/items and spit out a single JSON file). I've had some success doing this with Jekyll, but the items in the JSON array don't have unique id attributes, which Ember-data seems to expect.
Rationale
I am working with academic publications (where content is published and then expected to stand for years, if not decades). If I can eliminate the need for a live server backing the application, then the entire app can be downloaded and used off-line, or in an environment such as Cordova.
Aucun commentaire:
Enregistrer un commentaire