I'm fetching data using backbone.js with the following code. The .get and .set commands work fine, but if I set JSON data, then use .save(), I get a 404 (Not Found) error.
var ExampleModel = Backbone.Model.extend({});
var example = new ExampleModel({});
example.url = "data/example.json";
example.fetch();
I'm using a basic server with the connect.js module:
var util = require('util'),
connect = require('connect'),
port = 8080;
connect.createServer(connect.static(__dirname)).listen(port);
util.puts('Listening on ' + port + '...');
and example.json looks like so:
{
"home": "new york",
"status": "married",
"kids": "one"
}
Is the problem with my server? Any help will be greatly appreciated.Thanks!