@j3r3mcdev/oast-server 1.1.7 → 1.1.9
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/package.json +1 -1
- package/src/core/router.ts +4 -4
package/package.json
CHANGED
package/src/core/router.ts
CHANGED
|
@@ -22,13 +22,9 @@ export class CoreRouter {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
async dispatch(event: AnyNormalizedEvent): Promise<void> {
|
|
25
|
-
// 1. Log
|
|
26
25
|
this.logger.info(`Event received (${event.type})`, { id: event.id });
|
|
27
|
-
|
|
28
|
-
// 2. Save
|
|
29
26
|
await this.storage.save(event);
|
|
30
27
|
|
|
31
|
-
// 3. Hooks
|
|
32
28
|
for (const hook of this.hooks) {
|
|
33
29
|
try {
|
|
34
30
|
await hook(event);
|
|
@@ -38,6 +34,10 @@ export class CoreRouter {
|
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
36
|
|
|
37
|
+
async route(event: AnyNormalizedEvent): Promise<void> {
|
|
38
|
+
return this.dispatch(event);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
41
|
addHook(hook: RouterHook) {
|
|
42
42
|
this.hooks.push(hook);
|
|
43
43
|
}
|