|
|
|
@ -11,6 +11,7 @@ import { NextFunction, Request, Response } from 'express';
|
|
|
|
|
export class FrontendMiddleware implements NestMiddleware {
|
|
|
|
|
public indexHtmlDe = '';
|
|
|
|
|
public indexHtmlEn = '';
|
|
|
|
|
public indexHtmlEs = '';
|
|
|
|
|
public indexHtmlIt = '';
|
|
|
|
|
public indexHtmlNl = '';
|
|
|
|
|
public isProduction: boolean;
|
|
|
|
@ -34,6 +35,10 @@ export class FrontendMiddleware implements NestMiddleware {
|
|
|
|
|
this.getPathOfIndexHtmlFile(DEFAULT_LANGUAGE_CODE),
|
|
|
|
|
'utf8'
|
|
|
|
|
);
|
|
|
|
|
this.indexHtmlEs = fs.readFileSync(
|
|
|
|
|
this.getPathOfIndexHtmlFile('es'),
|
|
|
|
|
'utf8'
|
|
|
|
|
);
|
|
|
|
|
this.indexHtmlIt = fs.readFileSync(
|
|
|
|
|
this.getPathOfIndexHtmlFile('it'),
|
|
|
|
|
'utf8'
|
|
|
|
@ -71,6 +76,15 @@ export class FrontendMiddleware implements NestMiddleware {
|
|
|
|
|
rootUrl: this.configurationService.get('ROOT_URL')
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
} else if (req.path === '/es' || req.path.startsWith('/es/')) {
|
|
|
|
|
res.send(
|
|
|
|
|
this.interpolate(this.indexHtmlIt, {
|
|
|
|
|
featureGraphicPath,
|
|
|
|
|
languageCode: 'es',
|
|
|
|
|
path: req.path,
|
|
|
|
|
rootUrl: this.configurationService.get('ROOT_URL')
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
} else if (req.path === '/it' || req.path.startsWith('/it/')) {
|
|
|
|
|
res.send(
|
|
|
|
|
this.interpolate(this.indexHtmlIt, {
|
|
|
|
|