@ccci/micro-server 1.0.59 → 1.0.61
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/index.js
CHANGED
|
@@ -119154,7 +119154,7 @@ class WebSocketServer {
|
|
|
119154
119154
|
// src/utils/ApplicationServer.ts
|
|
119155
119155
|
class ApplicationServer {
|
|
119156
119156
|
static app;
|
|
119157
|
-
static async bootstrap(port, options) {
|
|
119157
|
+
static async bootstrap(port, options, sync) {
|
|
119158
119158
|
ApplicationServer.app = import_express.default();
|
|
119159
119159
|
ApplicationServer.app.use(import_cors.default());
|
|
119160
119160
|
ApplicationServer.app.use(helmet());
|
|
@@ -119179,6 +119179,11 @@ class ApplicationServer {
|
|
|
119179
119179
|
const mailer = Mailer.getInstance();
|
|
119180
119180
|
mailer.connect(options);
|
|
119181
119181
|
}
|
|
119182
|
+
if (sync) {
|
|
119183
|
+
sync.forEach((model) => {
|
|
119184
|
+
DatabaseConnector.sync(model, true);
|
|
119185
|
+
});
|
|
119186
|
+
}
|
|
119182
119187
|
});
|
|
119183
119188
|
}
|
|
119184
119189
|
getInstance() {
|
|
@@ -9,8 +9,9 @@ export default class ApplicationServer {
|
|
|
9
9
|
* Initializes the application server
|
|
10
10
|
* @param {number} port port for the micro service
|
|
11
11
|
* @param {ApplicationOptionType} options additional server configuration
|
|
12
|
+
* @param {Array<String>} sync models to be sync to the database
|
|
12
13
|
*/
|
|
13
|
-
static bootstrap(port: number, options?: ApplicationOptionType): Promise<void>;
|
|
14
|
+
static bootstrap(port: number, options?: ApplicationOptionType, sync?: Array<string>): Promise<void>;
|
|
14
15
|
getInstance(): express.Application;
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=ApplicationServer.d.ts.map
|