@itrocks/framework 0.3.9 → 0.3.10
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/cjs/framework.d.ts +1 -0
- package/cjs/framework.js +3 -1
- package/cjs/main.d.ts +3 -0
- package/cjs/main.js +6 -2
- package/package.json +1 -1
package/cjs/framework.d.ts
CHANGED
package/cjs/framework.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReflectProperty = exports.ReflectClass = void 0;
|
|
3
|
+
exports.ReflectProperty = exports.ReflectClass = exports.servers = void 0;
|
|
4
4
|
require("@itrocks/class-file/automation");
|
|
5
5
|
const compose_1 = require("@itrocks/compose");
|
|
6
6
|
const config_1 = require("@itrocks/config");
|
|
7
7
|
const config_2 = require("@itrocks/config");
|
|
8
|
+
var main_1 = require("./main");
|
|
9
|
+
Object.defineProperty(exports, "servers", { enumerable: true, get: function () { return main_1.servers; } });
|
|
8
10
|
var reflect_class_1 = require("./reflect-class");
|
|
9
11
|
Object.defineProperty(exports, "ReflectClass", { enumerable: true, get: function () { return reflect_class_1.ReflectClass; } });
|
|
10
12
|
var reflect_property_1 = require("./reflect-property");
|
package/cjs/main.d.ts
CHANGED
package/cjs/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.servers = void 0;
|
|
3
4
|
exports.run = run;
|
|
4
5
|
const action_1 = require("@itrocks/action");
|
|
5
6
|
const action_2 = require("@itrocks/action");
|
|
@@ -60,7 +61,7 @@ async function run() {
|
|
|
60
61
|
getModule: route_1.routes.resolve.bind(route_1.routes),
|
|
61
62
|
isDomainObject: object => (0, class_type_1.isAnyType)(object) && !(object.prototype instanceof action_1.Action)
|
|
62
63
|
});
|
|
63
|
-
|
|
64
|
+
const server = new fastify_1.FastifyServer({
|
|
64
65
|
assetPath: app_dir_1.appDir,
|
|
65
66
|
execute: request => execute(new action_request_2.Request(request)),
|
|
66
67
|
favicon: config_1.config.container?.favicon ?? (0, node_path_2.normalize)((0, node_path_1.join)(__dirname, '../favicon.png')),
|
|
@@ -72,8 +73,11 @@ async function run() {
|
|
|
72
73
|
secret: config_1.config.session.secret ?? config_1.config.secret ?? 'defaultSecretHaving32CharactersOrGreater',
|
|
73
74
|
secure: config_1.config.server.secure ?? 'auto',
|
|
74
75
|
store: new fastify_file_session_store_1.FileStore((0, node_path_2.normalize)((0, node_path_1.join)(app_dir_1.appDir, config_1.config.session.path)))
|
|
75
|
-
})
|
|
76
|
+
});
|
|
77
|
+
server.run();
|
|
78
|
+
exports.servers.push(server);
|
|
76
79
|
}
|
|
80
|
+
exports.servers = new Array();
|
|
77
81
|
function toResponse(mixedResponse) {
|
|
78
82
|
return (typeof mixedResponse === 'string')
|
|
79
83
|
? new request_response_1.Response(mixedResponse)
|
package/package.json
CHANGED