javascript - how to use ember.js without server -
i following ember.js example on this site (http://todomvc.com/). clone project computer , double click index.html
, runs, expect.
but in ember's guide, tells me install ember-cli, , create new project, build it.
ember new myapp ember build
i can find files in /dist
, when double click index.html
fails.
this post said, "you have serve directory http server."
why need server run project, instead of opening in browser?
the example linked using old global ember. different ember-cli working with. http server required because of <base>
tag in index.html
file specifies base url use relative urls contained within document. when app trying serve assets/app.js
or assets/vendor.js
, trying relative base url, defined in config/environment.js
. defaults /
. need server respond resource requests assets. notice assets
folder relative index.html
file
Comments
Post a Comment