I\'m sending a file from client-side to server side using XHR:
$(document).on(\'drop\', function(dropEvent) {
dropEvent.preventDefault();
_.each(dropEven
By default, your routes are created as client side routes. This means, a link to that route will be handled in the browser vs. making a server request. But you can also create server side routes by providing a where
option to the route. The handler for the server side route exposes the request
, response
, and next
properties of the Connect
object. The syntax has changed a little from 0.5.4 to the dev branch so I'll provide both examples depending on which you're using:
v0.5.4
Router.map(function () {
this.route('upload', {
where: 'server',
handler: function () {
var request = this.request;
var response = this.response;
// do whatever
}
});
});
dev
Router.map(function () {
this.route('upload', {
where: 'server',
action: function () {
var request = this.request;
var response = this.response;
// do whatever
}
});
});