Skip to content

Commit 2b94f16

Browse files
feat(platform) add getType method
1 parent 6fc41ca commit 2b94f16

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

packages/core/adapters/http-adapter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ export abstract class AbstractHttpAdapter<
9696
abstract createMiddlewareFactory(
9797
requestMethod: RequestMethod,
9898
): (path: string, callback: Function) => any;
99+
abstract getType(): string;
99100
}

packages/platform-express/adapters/express-adapter.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ export class ExpressAdapter extends AbstractHttpAdapter {
135135
.forEach(parserKey => this.use(parserMiddleware[parserKey]));
136136
}
137137

138+
public getType(): string {
139+
return 'express';
140+
}
141+
138142
private isMiddlewareApplied(name: string): boolean {
139143
const app = this.getInstance();
140144
return (

packages/platform-fastify/adapters/fastify-adapter.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class FastifyAdapter extends AbstractHttpAdapter {
112112
);
113113
}
114114

115-
setViewEngine(options: any) {
115+
public setViewEngine(options: any) {
116116
return this.register(
117117
loadPackage('point-of-view', 'FastifyAdapter.setViewEngine()'),
118118
options,
@@ -167,4 +167,8 @@ export class FastifyAdapter extends AbstractHttpAdapter {
167167
});
168168
};
169169
}
170+
171+
public getType(): string {
172+
return 'fastify';
173+
}
170174
}

0 commit comments

Comments
 (0)