From a386f7828fe04ab16eca14b03ff85aefd62f3944 Mon Sep 17 00:00:00 2001 From: vincent178 Date: Mon, 19 Dec 2016 22:08:39 +0800 Subject: [PATCH] add two proxy methods and fix typo --- src/server/server-loader.ts | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/server/server-loader.ts b/src/server/server-loader.ts index b6c794a40a0..1d49c57cb7a 100644 --- a/src/server/server-loader.ts +++ b/src/server/server-loader.ts @@ -29,14 +29,14 @@ export interface IServerLifecycle { } /** - * ServerLoader provider all method to instanciate an ExpressServer. + * ServerLoader provider all method to instantiate an ExpressServer. * * It provide some features : * * * Middleware importation, * * Scan directory. You can specify controllers and services directory in your project, * * Error management (GlobalErrorHandler), - * * Authentification strategy. + * * Authentication strategy. * */ export abstract class ServerLoader { @@ -150,6 +150,32 @@ export abstract class ServerLoader { return this; } + /** + * Proxy to express set + * @param setting + * @param val + * @returns {ServerLoader} + */ + public set(setting: string, val: any): ServerLoader { + + this.expressApp.set(setting, val); + + return this; + } + + /** + * Proxy to express engine + * @param ext + * @param fn + * @returns {ServerLoader} + */ + public engine(ext: string, fn: Function): ServerLoader { + + this.expressApp.engine(ext, fn); + + return this; + } + /** * Initialize configuration of the express app. */