webserver - How to run a Sencha Touch 2 app without a web server? -


does have idea on how run sencha touch 2 app without installing web server (like lamp/xamp). (ps : i'm new sencha touch)

i know there 1 way - including phonegap's javascript file in app.json of sencha touch 2 app. which'll this

"js":     {         "path": "cordova-2.5.0.js"       } 

after sample application runs on browser without web server.

  1. is there other way?

  2. how adding phonegap js file in running sencha touch app without web server anyway??

starting chrome --allow-file-access-from-files --disable-web-security flags trick.

sencha requires web server because if app in development mode microloader in sencha make ajax request app.json file , it, loads other files. can see in

../sencha-sdk/mircroloader/development.js

file following code -

var xhr = new xmlhttprequest(); xhr.open('get', 'app.json', false); 

when start chrome above mentioned flags, chrome allow making ajax requests if file opened file://.... url scheme.

when deploy app after compressing js/css sencha cmd, files bunched 1 single file. no more need webserver in case.


update

from cordova docs whitelisting domain

domain whitelisting in apache cordova security model controls access outside domains, such http://google.com. default security policy block network access. application developer can declare access specific network domains , subdomains.

and

in widget access specification, element used declare access specific network domains. in future, apache cordova abstract platform whitelisting implementations w3c widget access specification. however, each platform must implement it's own domain whitelisting.

moreover, w3c widget access not enclose security , user agent enforce policy. defined in xmlhttprequest.

so cordova essential is, adds exception in policy allow access network resource outside app domain whitelisted domains.


Comments