else {
this.respond( req, res, path, this.codes.SUCCESS, headers, true );
}
}
else {
this.respond( req, res, this.messages.NO_CONTENT, this.codes.SUCCESS, headers );
}
}
else if ( method === "DELETE" && del ) {
this.unregister( this.url( req ) );
fs.unlink( path, function ( e ) {
if ( e ) {
self.error( req, req, self.codes.SERVER_ERROR );
}
else {
self.respond( req, res, self.messages.NO_CONTENT, self.codes.NO_CONTENT, {} );
}
} );
}
else if ( method === "PUT" && write ) {
this.write( req, res, path );
}
else {
this.error( req, req, this.codes.SERVER_ERROR );
}
}
Method handle
Handles the request
Parameters:
req must be an Object.
(HTTP(S) request Object)
res must be an Object.
(HTTP(S) response Object)
path must be a String.
(File path)
url must be a String.
(Requested URL)
dir must be a Boolean.
(
true
ispath
is a directory)stat must be an Object.
(fs.Stat Object)
Returns an Object
(TurtleIO instance)