parent
8add4917d5
commit
44f7ab3f33
2 changed files with 22 additions and 0 deletions
|
@ -29,6 +29,22 @@ DocumentHandler.prototype.handleGet = function(key, response, skipExpire) {
|
|||
}, skipExpire);
|
||||
};
|
||||
|
||||
// Handle retrieving the raw version of a document
|
||||
DocumentHandler.prototype.handleRawGet = function(key, response, skipExpire) {
|
||||
this.store.get(key, function(ret) {
|
||||
if (ret) {
|
||||
winston.verbose('retrieved raw document', { key: key });
|
||||
response.writeHead(200, { 'content-type': 'text/plain' });
|
||||
response.end(ret);
|
||||
}
|
||||
else {
|
||||
winston.warn('raw document not found', { key: key });
|
||||
response.writeHead(404, { 'content-type': 'application/json' });
|
||||
response.end(JSON.stringify({ message: 'document not found' }));
|
||||
}
|
||||
}, skipExpire);
|
||||
};
|
||||
|
||||
// Handle adding a new Document
|
||||
DocumentHandler.prototype.handlePost = function(request, response) {
|
||||
var _this = this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue