@less-is-more/less-js 1.2.13 → 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +3 -0
- package/package.json +1 -1
- package/src/router.js +6 -4
package/package.json
CHANGED
package/src/router.js
CHANGED
|
@@ -53,8 +53,7 @@ module.exports = class Router {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
static _getPath(req) {
|
|
56
|
-
console.log("
|
|
57
|
-
console.log("path: " + req.path);
|
|
56
|
+
console.log("path:", req.method, req.path);
|
|
58
57
|
const paths = req.path.split("/");
|
|
59
58
|
const className = paths.length > 2 ? "/" + paths[paths.length - 2] : "/";
|
|
60
59
|
const methodName = paths[paths.length - 1];
|
|
@@ -73,8 +72,8 @@ module.exports = class Router {
|
|
|
73
72
|
if (req.method == "POST") {
|
|
74
73
|
if (isFile) {
|
|
75
74
|
await this._getFile(req);
|
|
76
|
-
console.log("params", req.params);
|
|
77
|
-
console.log("files", req.files);
|
|
75
|
+
console.log("params:", req.params);
|
|
76
|
+
console.log("files:", req.files);
|
|
78
77
|
} else {
|
|
79
78
|
const data = await promisify(body)(req);
|
|
80
79
|
console.log("body: " + decodeURIComponent(data));
|
|
@@ -106,11 +105,14 @@ module.exports = class Router {
|
|
|
106
105
|
static _handleReturn(result, res) {
|
|
107
106
|
if (!Param.isBlank(result)) {
|
|
108
107
|
if (result instanceof Ret) {
|
|
108
|
+
console.log("return:", result.toString());
|
|
109
109
|
res.send(result.toString());
|
|
110
110
|
} else {
|
|
111
111
|
if (typeof result === "string") {
|
|
112
|
+
console.log("return:", result);
|
|
112
113
|
res.send(result);
|
|
113
114
|
} else {
|
|
115
|
+
console.log("return:", JSON.stringify(result));
|
|
114
116
|
res.send(JSON.stringify(result));
|
|
115
117
|
}
|
|
116
118
|
}
|