cgserver 8.9.5 → 8.9.7
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/README.md
CHANGED
|
@@ -87,6 +87,11 @@ class Engine {
|
|
|
87
87
|
let req = new Request_1.Request(_req, this._cfg);
|
|
88
88
|
let res = new Response_1.Response(_res, this._cfg);
|
|
89
89
|
let method = req.method.toLowerCase();
|
|
90
|
+
if (method == "head") {
|
|
91
|
+
_res.status(200).send("");
|
|
92
|
+
Log_1.GLog.info(_res);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
90
95
|
if (method != "get" && method != "post") {
|
|
91
96
|
return;
|
|
92
97
|
}
|
|
@@ -128,11 +133,11 @@ class Engine {
|
|
|
128
133
|
stop() {
|
|
129
134
|
}
|
|
130
135
|
getRenderHtml(req, res, datas) {
|
|
131
|
-
let
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
tmpl = "modules/" + req.module.toLowerCase() + "/" + tmpl;
|
|
136
|
+
let rootview = this._cfg.rootview || "view";
|
|
137
|
+
if (!rootview.endsWith("/")) {
|
|
138
|
+
rootview += "/";
|
|
135
139
|
}
|
|
140
|
+
let tmpl = rootview + req.controller.toLowerCase() + "/" + req.action.toLowerCase();
|
|
136
141
|
let html = this._getRenderHtml(req, res, tmpl, datas);
|
|
137
142
|
return html;
|
|
138
143
|
}
|
|
@@ -18,5 +18,5 @@ export declare class Engine {
|
|
|
18
18
|
protected _all(_req: Express.Request, _res: Express.Response): Promise<void>;
|
|
19
19
|
stop(): void;
|
|
20
20
|
getRenderHtml(req: Request, res: Response, datas: any): any;
|
|
21
|
-
protected _getRenderHtml(req: Request, res: Response, tmpl:
|
|
21
|
+
protected _getRenderHtml(req: Request, res: Response, tmpl: string, params: any): any;
|
|
22
22
|
}
|