diff options
author | Thomas Davis <thomasalwyndavis@gmail.com> | 2012-04-22 22:34:49 +1000 |
---|---|---|
committer | Thomas Davis <thomasalwyndavis@gmail.com> | 2012-04-22 22:34:49 +1000 |
commit | 8c649cecb0078addaf63a5e44f6a95eb930d15cc (patch) | |
tree | 142263d2e78addfbc88d7bbc363de919820c33d6 /examples/nodejs-mongodb-mongoose-restify/js/main.js | |
parent | e5f8494a4fb9ce62cf1cb7015451694c18ddf006 (diff) | |
download | backbonetutorials-8c649cecb0078addaf63a5e44f6a95eb930d15cc.zip backbonetutorials-8c649cecb0078addaf63a5e44f6a95eb930d15cc.tar.gz backbonetutorials-8c649cecb0078addaf63a5e44f6a95eb930d15cc.tar.bz2 |
blh
Diffstat (limited to 'examples/nodejs-mongodb-mongoose-restify/js/main.js')
-rw-r--r-- | examples/nodejs-mongodb-mongoose-restify/js/main.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/nodejs-mongodb-mongoose-restify/js/main.js b/examples/nodejs-mongodb-mongoose-restify/js/main.js new file mode 100644 index 0000000..b5a5557 --- /dev/null +++ b/examples/nodejs-mongodb-mongoose-restify/js/main.js @@ -0,0 +1,33 @@ +// Require.js allows us to configure shortcut alias +// Their usage will become more apparent futher along in the tutorial. +require.config({ + paths: { + // Major libraries + jquery: 'libs/jquery/jquery-min', + underscore: 'libs/underscore/underscore-min', // https://github.com/amdjs + backbone: 'libs/backbone/backbone-min', // https://github.com/amdjs + sinon: 'libs/sinon/sinon.js', + + // Require.js plugins + text: 'libs/require/text', + order: 'libs/require/order', + + // Just a short cut so we can put our html outside the js dir + // When you have HTML/CSS designers this aids in keeping them out of the js directory + templates: '../templates' + }, + urlArgs: "bust=" + (new Date()).getTime() + +}); + +// Let's kick off the application + +require([ + 'views/app', + 'router', + 'vm' +], function(AppView, Router, Vm){ + var appView = Vm.create({}, 'AppView', AppView); + Router.initialize({appView: appView}); + appView.render(); // render() calls Backbone.history when its ready to start +}); |