express-service-bootstrap
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "express-service-bootstrap", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "This is a convenience package for starting a express API with security, health checks, process exits etc.", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -81,7 +81,7 @@ /// <reference types="node" /> | ||
/** | ||
* Used to register a middleware. | ||
* @param {(request: Request, response: Response, next: NextFunction) => Promise<void>} middleware middleware to be registered. | ||
* @returns {ApplicationBuilder} ApplicationBuilder instance. | ||
*/ | ||
registerApplicationMiddleware(middleware: (request: Request, response: Response, next: NextFunction) => Promise<void>): ApplicationBuilder; | ||
* Used to register a SYNC/ASYNC middleware. | ||
* @param {(request: Request, response: Response, next: NextFunction) => Promise<void>|void} middleware middleware to be registered. | ||
* @returns {ApplicationBuilder} ApplicationBuilder instance. | ||
*/ | ||
registerApplicationMiddleware(middleware: (request: Request, response: Response, next: NextFunction) => Promise<void> | void): ApplicationBuilder; | ||
/** | ||
@@ -88,0 +88,0 @@ * Used to register a router. |
@@ -144,6 +144,6 @@ "use strict"; | ||
/** | ||
* Used to register a middleware. | ||
* @param {(request: Request, response: Response, next: NextFunction) => Promise<void>} middleware middleware to be registered. | ||
* @returns {ApplicationBuilder} ApplicationBuilder instance. | ||
*/ | ||
* Used to register a SYNC/ASYNC middleware. | ||
* @param {(request: Request, response: Response, next: NextFunction) => Promise<void>|void} middleware middleware to be registered. | ||
* @returns {ApplicationBuilder} ApplicationBuilder instance. | ||
*/ | ||
registerApplicationMiddleware(middleware) { | ||
@@ -150,0 +150,0 @@ this.appMiddlewares.push(middleware); |
@@ -37,2 +37,10 @@ import { BootstrapConstructor } from "./bootstrap-constructor"; | ||
/** | ||
* Fetches an existing instance based on name. | ||
* @param {string} name The name of the instance | ||
* @returns The instance of the class or undefined if it does not exist | ||
* @template InstanceType The type of the instance | ||
* @returns {InstanceType | undefined} The instance of the class or undefined if it does not exist | ||
*/ | ||
fetchInstance<InstanceType>(name: string): InstanceType | undefined; | ||
/** | ||
* Disposes an existing instance based on name. | ||
@@ -39,0 +47,0 @@ * @param {string} name The name of the instance |
@@ -74,2 +74,12 @@ "use strict"; | ||
/** | ||
* Fetches an existing instance based on name. | ||
* @param {string} name The name of the instance | ||
* @returns The instance of the class or undefined if it does not exist | ||
* @template InstanceType The type of the instance | ||
* @returns {InstanceType | undefined} The instance of the class or undefined if it does not exist | ||
*/ | ||
fetchInstance(name) { | ||
return this.singletonContainer.get(name); | ||
} | ||
/** | ||
* Disposes an existing instance based on name. | ||
@@ -76,0 +86,0 @@ * @param {string} name The name of the instance |
import { K8SHealthStatus } from './enum-k8s-health-status'; | ||
import { ApplicationBuilder } from './application-builder'; | ||
export { K8SHealthStatus, ApplicationBuilder }; | ||
import { BootstrapConstructor } from './bootstrap-constructor'; | ||
import { DisposableSingletonContainer } from './disposable-singleton-container'; | ||
export { K8SHealthStatus, ApplicationBuilder, BootstrapConstructor, DisposableSingletonContainer }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ApplicationBuilder = exports.K8SHealthStatus = void 0; | ||
exports.DisposableSingletonContainer = exports.BootstrapConstructor = exports.ApplicationBuilder = exports.K8SHealthStatus = void 0; | ||
const enum_k8s_health_status_1 = require("./enum-k8s-health-status"); | ||
@@ -8,2 +8,6 @@ Object.defineProperty(exports, "K8SHealthStatus", { enumerable: true, get: function () { return enum_k8s_health_status_1.K8SHealthStatus; } }); | ||
Object.defineProperty(exports, "ApplicationBuilder", { enumerable: true, get: function () { return application_builder_1.ApplicationBuilder; } }); | ||
const bootstrap_constructor_1 = require("./bootstrap-constructor"); | ||
Object.defineProperty(exports, "BootstrapConstructor", { enumerable: true, get: function () { return bootstrap_constructor_1.BootstrapConstructor; } }); | ||
const disposable_singleton_container_1 = require("./disposable-singleton-container"); | ||
Object.defineProperty(exports, "DisposableSingletonContainer", { enumerable: true, get: function () { return disposable_singleton_container_1.DisposableSingletonContainer; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ This is free and unencumbered software released into the public domain. |
{ | ||
"name": "express-service-bootstrap", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "This is a convenience package for starting a express API with security, health checks, process exits etc.", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -0,0 +0,0 @@ # express-service-bootstrap |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
54690
680