@appolo/agent
Advanced tools
Comparing version 8.0.6 to 8.0.7
@@ -210,4 +210,5 @@ "use strict"; | ||
try { | ||
this._events.beforeServerClosed.fireEvent(); | ||
await utils_1.Promises.fromCallback(c => this._server.close(c)); | ||
this._events.serverClosed.fireEvent(); | ||
this._events.afterServerClosed.fireEvent(); | ||
} | ||
@@ -222,3 +223,5 @@ catch (e) { | ||
this._initialize(); | ||
await this._events.beforeServerOpen.fireEvent(); | ||
await utils_1.Promises.fromCallback(c => this._server.listen(port, c)); | ||
await this._events.afterServerOpen.fireEvent(); | ||
(cb) && cb(this); | ||
@@ -225,0 +228,0 @@ return this; |
@@ -312,5 +312,10 @@ import {IOptions} from "./IOptions"; | ||
try { | ||
(this._events.beforeServerClosed as Event<void>).fireEvent(); | ||
await Promises.fromCallback(c => this._server.close(c)); | ||
(this._events.serverClosed as Event<void>).fireEvent(); | ||
(this._events.afterServerClosed as Event<void>).fireEvent(); | ||
} catch (e) { | ||
@@ -326,4 +331,8 @@ if (e.message !== "Not running" && e.code !== "ERR_SERVER_NOT_RUNNING") { | ||
await (this._events.beforeServerOpen as Event<void>).fireEvent(); | ||
await Promises.fromCallback(c => this._server.listen(port, c as any)); | ||
await (this._events.afterServerOpen as Event<void>).fireEvent(); | ||
(cb) && cb(this); | ||
@@ -330,0 +339,0 @@ |
@@ -8,3 +8,6 @@ "use strict"; | ||
this.routeAdded = new index_1.Event(); | ||
this.serverClosed = new index_1.Event(); | ||
this.beforeServerClosed = new index_1.Event(); | ||
this.afterServerClosed = new index_1.Event(); | ||
this.beforeServerOpen = new index_1.Event(); | ||
this.afterServerOpen = new index_1.Event(); | ||
} | ||
@@ -11,0 +14,0 @@ } |
@@ -6,3 +6,6 @@ import {Event, IEvent} from "@appolo/events/index"; | ||
public readonly routeAdded: IEvent<RouteAddedEvent> = new Event(); | ||
public readonly serverClosed: IEvent<void> = new Event(); | ||
public readonly beforeServerClosed: IEvent<void> = new Event(); | ||
public readonly afterServerClosed: IEvent<void> = new Event(); | ||
public readonly beforeServerOpen: IEvent<void> = new Event(); | ||
public readonly afterServerOpen: IEvent<void> = new Event(); | ||
} |
@@ -19,3 +19,2 @@ import http = require('http'); | ||
params?: { [index: string]: any } | ||
model?: { [index: string]: any } | ||
next?: NextFn | ||
@@ -22,0 +21,0 @@ pathName: string |
@@ -30,3 +30,3 @@ { | ||
"main": "./index.js", | ||
"version": "8.0.6", | ||
"version": "8.0.7", | ||
"license": "MIT", | ||
@@ -33,0 +33,0 @@ "repository": { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119104
2056