PDA

View Full Version : index.html outside application-dir for generated/bootstrapped app



Spenna
21 Nov 2013, 4:08 AM
Hi all.

We're using the sencha cmd to maintain our app, but have some problems setting things up nicely to bridge between development and production.

Basically, our development version of the app resides in '<webroot>/js/<appname>' and this folder contains the generated index.html file:


<html>
<head>
<meta charset="UTF-8">
<title>AppName</title>
<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<link rel="stylesheet" href="bootstrap.css">
<script src="ext/ext-dev.js"></script>
<script src="bootstrap.js"></script>
<!-- </x-bootstrap> -->
<script src="app.js"></script>
<!-- </x-compile> -->
</head>
<body></body>
</html>


So to utitilize the bootstrap loader we have to hit the index.html file in that subfolder. (i.e http://example.com/js/<appname>/index.html)

I would like this index.html to be outside the app dir (i.e directly in <webroot>-folder), but can't find how to specify what base url Ext should use.
Just moving the index.html file and changing paths inside it does not work:


<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>AppName</title>
<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<link rel="stylesheet" href="/js/<appname>/bootstrap.css">
<script src="/js/<appname>/ext/ext-dev.js"></script>
<script src="/js/<appname>/bootstrap.js"></script>
<!-- </x-bootstrap> -->
<script src="/js/<appname>/app.js"></script>
<!-- </x-compile> -->
</head>
<body></body>
</html>


For the built/production version this works fine, since its all working off of the path it resides in.

Anyone has some trick up their sleeve?

Gary Schlosberg
25 Nov 2013, 10:21 AM
I've not tried this myself, but perhaps this thread will be of some help.
http://www.sencha.com/forum/showthread.php?264354

Spenna
26 Nov 2013, 1:11 AM
Thanks for your input, but unfortunately that thread only proposes other paths for compiled/built version.
I want to have the index.html outside the app dir for the development version, but seems there is no way to do it using the bootstrap loader.