-
Notifications
You must be signed in to change notification settings - Fork 10
Filesystem
The Backbone Boilerplate has been designed to work well with and without a server. If you are using it within Adobe Air or PhoneGap, for instance, you will not have a server to run it through.
Note: If you are using it without a server, make sure you have permissions to do local AJAX requests, otherwise you should switch to using inline templates to avoid having to make an AJAX request
You will need to update the root property inside the app
object which exists
inside app/app.js
and update the paths inside index.html
. Assuming your
application is located at the path: file:///Users/timbranyen/Sites/myapp/
,
the configuration would look something like this:
// Provide a global location to place configuration settings and module
// creation.
var app = {
// The root path to run the application through.
root: "file:///Users/timbranyen/Sites/myapp/"
};
After you have updated the root, update index.html
to ensure it points to the
correct paths.
<!-- Point the stylesheet to your CSS. -->
<link rel="stylesheet" href="file:///Users/timbranyen/Sites/myapp/assets/css/index.css">
<!-- Point the configuration file and RequireJS to your filesystem. -->
<script data-main="file:///Users/timbranyen/Sites/myapp/app/config"
src="file:///Users/timbranyen/Sites/myapp/assets/js/libs/require.js"></script>
If you are interested in deploying your application where you do not have
the privilege of using asynchronous or built templates, you can easily swap
out the fetch
method to pull from the index.html
file.