speedly 2.0.10 → 2.0.12
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/dist/cjs/config/init.js
CHANGED
|
@@ -6,11 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.default = speedly;
|
|
7
7
|
const express_1 = __importDefault(require("express"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const document_1 = __importDefault(require("../document"));
|
|
9
11
|
const defaultConfig = {
|
|
10
12
|
notFoundHandler: true,
|
|
11
13
|
errorHandler: true,
|
|
12
14
|
homeHandler: true,
|
|
13
15
|
jsonParser: true,
|
|
16
|
+
documentation: true,
|
|
14
17
|
urlEncodedParser: true,
|
|
15
18
|
cookieParser: true,
|
|
16
19
|
staticFiles: true,
|
|
@@ -29,10 +32,13 @@ function speedly(config = {}) {
|
|
|
29
32
|
}
|
|
30
33
|
catch (error) {
|
|
31
34
|
if (error.code === "MODULE_NOT_FOUND") {
|
|
32
|
-
console.warn("cookie-parser module not
|
|
35
|
+
console.warn("cookie-parser module not founds. Please reinstall it to use cookieParser middleware.");
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
}
|
|
39
|
+
if (finalConfig.documentation &&
|
|
40
|
+
fs_1.default.existsSync(path_1.default.join(process.cwd(), "src/module")))
|
|
41
|
+
(0, document_1.default)(app, path_1.default.join(process.cwd(), "src/module"));
|
|
36
42
|
if (finalConfig.staticFiles)
|
|
37
43
|
app.use("/static", express_1.default.static("public"));
|
|
38
44
|
if (finalConfig.homeHandler) {
|
package/dist/esm/config/init.js
CHANGED
|
@@ -6,11 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.default = speedly;
|
|
7
7
|
const express_1 = __importDefault(require("express"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const document_1 = __importDefault(require("../document"));
|
|
9
11
|
const defaultConfig = {
|
|
10
12
|
notFoundHandler: true,
|
|
11
13
|
errorHandler: true,
|
|
12
14
|
homeHandler: true,
|
|
13
15
|
jsonParser: true,
|
|
16
|
+
documentation: true,
|
|
14
17
|
urlEncodedParser: true,
|
|
15
18
|
cookieParser: true,
|
|
16
19
|
staticFiles: true,
|
|
@@ -29,10 +32,13 @@ function speedly(config = {}) {
|
|
|
29
32
|
}
|
|
30
33
|
catch (error) {
|
|
31
34
|
if (error.code === "MODULE_NOT_FOUND") {
|
|
32
|
-
console.warn("cookie-parser module not
|
|
35
|
+
console.warn("cookie-parser module not founds. Please reinstall it to use cookieParser middleware.");
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
}
|
|
39
|
+
if (finalConfig.documentation &&
|
|
40
|
+
fs_1.default.existsSync(path_1.default.join(process.cwd(), "src/module")))
|
|
41
|
+
(0, document_1.default)(app, path_1.default.join(process.cwd(), "src/module"));
|
|
36
42
|
if (finalConfig.staticFiles)
|
|
37
43
|
app.use("/static", express_1.default.static("public"));
|
|
38
44
|
if (finalConfig.homeHandler) {
|