mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 01:47:35 +00:00
feature(cloudcmd) rm ?json
This commit is contained in:
parent
b9eb68f792
commit
1cbd959a46
1 changed files with 2 additions and 10 deletions
12
cloudcmd.js
12
cloudcmd.js
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue