Skip to content

Commit c1d3bad

Browse files
authored
Merge pull request #58 from Findeton/add-plugins
add support for registering plugins
2 parents b313dec + b2b1250 commit c1d3bad

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/http/drivers/FastifyServer.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ export class FastifyServer implements Process {
104104
// Attach the container to the server
105105
this.server.decorateRequest("container", container)
106106

107+
let plugins = this.getPlugins(container)
108+
for (let p of plugins) {
109+
this.server.register(p)
110+
}
111+
107112
let middleware = this.getMiddleware(container)
108113
for (let m of middleware) {
109114
this.server.use(m)
@@ -129,6 +134,12 @@ export class FastifyServer implements Process {
129134
return []
130135
}
131136

137+
protected getPlugins(
138+
container: Container
139+
): Array<Fastify.Plugin<any, any, any, any>> {
140+
return []
141+
}
142+
132143
protected getRequestMetadata = (
133144
request: Fastify.FastifyRequest<any, any, any, any, any>
134145
): { [key: string]: any } => ({})

0 commit comments

Comments
 (0)