@drayman/framework 2.1.0 → 2.2.0
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/commands/start.js +7 -2
- package/dist/config.js +5 -1
- package/package.json +2 -2
package/dist/commands/start.js
CHANGED
|
@@ -28,10 +28,12 @@ const multer_1 = __importDefault(require("multer"));
|
|
|
28
28
|
const path_1 = __importDefault(require("path"));
|
|
29
29
|
const shortid_1 = __importDefault(require("shortid"));
|
|
30
30
|
const ws_1 = __importDefault(require("ws"));
|
|
31
|
+
const https_1 = __importDefault(require("https"));
|
|
32
|
+
const fs_1 = __importDefault(require("fs"));
|
|
31
33
|
const build_1 = require("./build");
|
|
32
34
|
const config_1 = require("../config");
|
|
33
35
|
(async () => {
|
|
34
|
-
const { publicDir, port, componentsOutputDir, outDir } = (0, config_1.getDraymanConfig)();
|
|
36
|
+
const { publicDir, port, componentsOutputDir, outDir, sslKey, sslCert } = (0, config_1.getDraymanConfig)();
|
|
35
37
|
const elementsPaths = await draymanCore.getElementsScriptPaths({});
|
|
36
38
|
await (0, build_1.build)();
|
|
37
39
|
const storage = multer_1.default.memoryStorage();
|
|
@@ -98,7 +100,10 @@ const config_1 = require("../config");
|
|
|
98
100
|
process.on('uncaughtException', function (err) {
|
|
99
101
|
console.log(err);
|
|
100
102
|
});
|
|
101
|
-
const server =
|
|
103
|
+
const server = (sslKey && sslCert) ? https_1.default.createServer({
|
|
104
|
+
key: fs_1.default.readFileSync(sslKey),
|
|
105
|
+
cert: fs_1.default.readFileSync(sslCert),
|
|
106
|
+
}, app).listen(port) : app.listen(port);
|
|
102
107
|
console.log(`Drayman started at http://localhost:${port}`);
|
|
103
108
|
server.setTimeout(0);
|
|
104
109
|
const wss = new ws_1.default.Server({ server });
|
package/dist/config.js
CHANGED
|
@@ -14,6 +14,8 @@ function getDraymanConfig() {
|
|
|
14
14
|
const postcssSourceFile = draymanConfig.postcss?.source || `${srcDir}/styles.css`;
|
|
15
15
|
const postcssDestinationFile = draymanConfig.postcss?.destination || `${publicDir}/styles.css`;
|
|
16
16
|
const port = draymanConfig.port || 3033;
|
|
17
|
+
const sslCert = draymanConfig.sslCert;
|
|
18
|
+
const sslKey = draymanConfig.sslKey;
|
|
17
19
|
return {
|
|
18
20
|
srcDir,
|
|
19
21
|
publicDir,
|
|
@@ -21,7 +23,9 @@ function getDraymanConfig() {
|
|
|
21
23
|
componentsOutputDir,
|
|
22
24
|
postcssSourceFile,
|
|
23
25
|
postcssDestinationFile,
|
|
24
|
-
port
|
|
26
|
+
port,
|
|
27
|
+
sslCert,
|
|
28
|
+
sslKey,
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
31
|
exports.getDraymanConfig = getDraymanConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drayman/framework",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"npm": "^7.10.0",
|
|
48
48
|
"start-server-and-test": "^1.12.1"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ec3c8bf40d30ead00090e4a8179c47d008f458ba"
|
|
51
51
|
}
|