MCPcopy
hub / github.com/hapijs/hapi / add

Method add

lib/ext.js:25–54  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

23 }
24
25 add(event) {
26
27 const methods = [].concat(event.method);
28 for (const method of methods) {
29 const settings = {
30 before: event.options.before,
31 after: event.options.after,
32 group: event.realm.plugin,
33 sort: this.#core.extensionsSeq++
34 };
35
36 const node = {
37 func: method, // Request: function (request, h), Server: function (server)
38 bind: event.options.bind,
39 server: event.server, // Server event
40 realm: event.realm,
41 timeout: event.options.timeout
42 };
43
44 this.#topo.add(node, settings);
45 }
46
47 this.nodes = this.#topo.nodes;
48
49 // Notify routes
50
51 for (const route of this.#routes) {
52 route.rebuild(event);
53 }
54 }
55
56 merge(others) {
57

Callers

nothing calls this directly

Calls 2

rebuildMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected