|
@@ -27,6 +27,7 @@ class Server {
|
|
private readonly middlewaresPath?: string;
|
|
private readonly middlewaresPath?: string;
|
|
private readonly routesPath?: string;
|
|
private readonly routesPath?: string;
|
|
private readonly viewEngine?: string;
|
|
private readonly viewEngine?: string;
|
|
|
|
+ private readonly viewsPath?: string;
|
|
|
|
|
|
public constructor(properties: ServerProperties) {
|
|
public constructor(properties: ServerProperties) {
|
|
this.instance = express();
|
|
this.instance = express();
|
|
@@ -40,6 +41,7 @@ class Server {
|
|
this.middlewaresPath = properties.middlewaresPath;
|
|
this.middlewaresPath = properties.middlewaresPath;
|
|
this.routesPath = properties.routesPath;
|
|
this.routesPath = properties.routesPath;
|
|
this.viewEngine = properties.viewEngine;
|
|
this.viewEngine = properties.viewEngine;
|
|
|
|
+ this.viewsPath = properties.viewsPath;
|
|
this.initialized = false;
|
|
this.initialized = false;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -61,6 +63,8 @@ class Server {
|
|
await this.registerRoutes(this.routesPath);
|
|
await this.registerRoutes(this.routesPath);
|
|
if(this.viewEngine)
|
|
if(this.viewEngine)
|
|
this.instance.set('view engine', this.viewEngine);
|
|
this.instance.set('view engine', this.viewEngine);
|
|
|
|
+ if(this.viewsPath)
|
|
|
|
+ this.instance.set('views', this.viewsPath);
|
|
}
|
|
}
|
|
|
|
|
|
private processHttpHandlers(): void {
|
|
private processHttpHandlers(): void {
|