feature(cloudcmd) rm ?json

This commit is contained in:
coderaiser 2014-05-24 11:24:52 -04:00
parent b9eb68f792
commit 1cbd959a46

View file

@ -232,23 +232,15 @@
name = Util.rmStrOnce(name, CloudFunc.FS) || main.SLASH;
getContent(name, function(error, data, isFile) {
var json,
NOT_LOG = true,
query = main.getQuery(request),
isJSON = Util.isContainStr(query, 'json');
if (error)
main.sendError(p, error);
else if (isFile) {
p.name = name;
main.sendFile(p);
} else if (isJSON) {
p.name +='.json';
p.query = query;
json = Util.stringifyJSON(data);
main.sendResponse(p, json, NOT_LOG);
} else
readIndex(data, function(error, data) {
var NOT_LOG = true;
p.name = INDEX_PATH;
if (error)