Take the 2-minute tour ×  Fairly new to JavaScript so it might
be a noobish question.  At the moment for my project I'm using
NodeJS for my server and Backbone for the client. The client
will send a request to the server and the server will send list
of files in the server, my aim was to simply return the list of
files and when user click on the file it will send another
request to the server to load the file.  Currently in the client
level my model and collection is defined something like:
app.MyFile = Backbone.Model.extend({     defaults: {
modifiedDate: new Date(),         path: '',         content: ''
// content of the file  var MyFileList =
Backbone.Collection.extend({   model: app.MyFile,   url:
'/api/files'  // create global collection of files app.MyFiles =
new MyFileList();  app.AppView = Backbone.View.extend({
initialize: function () {     // fetch all files  // app.js
(point of entry) $(function() {   // Kick things off by creating
the **App**.   new app.AppView();  And my server code: