Release 1.179.5 (#1150)
This commit is contained in:
parent
053a5cc5b5
commit
108c0c13c4
@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## 1.179.4 - 13.08.2022
|
||||
## 1.179.5 - 15.08.2022
|
||||
|
||||
### Added
|
||||
|
||||
|
@ -87,11 +87,6 @@
|
||||
"input": "",
|
||||
"output": "./../assets"
|
||||
},
|
||||
{
|
||||
"glob": "index.html",
|
||||
"input": "apps/client/src/assets",
|
||||
"output": "./../"
|
||||
},
|
||||
{
|
||||
"glob": "LICENSE",
|
||||
"input": "",
|
||||
|
@ -10,7 +10,7 @@ import { ExchangeRateDataModule } from '@ghostfolio/api/services/exchange-rate-d
|
||||
import { PrismaModule } from '@ghostfolio/api/services/prisma.module';
|
||||
import { TwitterBotModule } from '@ghostfolio/api/services/twitter-bot/twitter-bot.module';
|
||||
import { BullModule } from '@nestjs/bull';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { MiddlewareConsumer, Module, RequestMethod } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { ScheduleModule } from '@nestjs/schedule';
|
||||
import { ServeStaticModule } from '@nestjs/serve-static';
|
||||
@ -23,6 +23,7 @@ import { AuthModule } from './auth/auth.module';
|
||||
import { BenchmarkModule } from './benchmark/benchmark.module';
|
||||
import { CacheModule } from './cache/cache.module';
|
||||
import { ExportModule } from './export/export.module';
|
||||
import { FrontendMiddleware } from './frontend.middleware';
|
||||
import { ImportModule } from './import/import.module';
|
||||
import { InfoModule } from './info/info.module';
|
||||
import { OrderModule } from './order/order.module';
|
||||
@ -82,4 +83,10 @@ import { UserModule } from './user/user.module';
|
||||
controllers: [AppController],
|
||||
providers: [CronService]
|
||||
})
|
||||
export class AppModule {}
|
||||
export class AppModule {
|
||||
configure(consumer: MiddlewareConsumer) {
|
||||
consumer
|
||||
.apply(FrontendMiddleware)
|
||||
.forRoutes({ path: '*', method: RequestMethod.ALL });
|
||||
}
|
||||
}
|
||||
|
33
apps/api/src/app/frontend.middleware.ts
Normal file
33
apps/api/src/app/frontend.middleware.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import * as path from 'path';
|
||||
|
||||
import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config';
|
||||
import { Injectable, NestMiddleware } from '@nestjs/common';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
|
||||
@Injectable()
|
||||
export class FrontendMiddleware implements NestMiddleware {
|
||||
use(req: Request, res: Response, next: NextFunction) {
|
||||
if (req.path.startsWith('/api/') || this.isFileRequest(req.url)) {
|
||||
// Skip
|
||||
next();
|
||||
} else {
|
||||
res.sendFile(
|
||||
path.join(
|
||||
__dirname,
|
||||
'..',
|
||||
'client',
|
||||
DEFAULT_LANGUAGE_CODE,
|
||||
'index.html'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private isFileRequest(filename: string) {
|
||||
if (filename.includes('auth/ey')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return filename.split('.').pop() !== filename;
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ghostfol.io</title>
|
||||
<link rel="canonical" href="https://ghostfol.io/en/" />
|
||||
<meta name="robots" content="noindex" />
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="refresh" content="0; url=./en/" />
|
||||
</head>
|
||||
</html>
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ghostfolio",
|
||||
"version": "1.179.4",
|
||||
"version": "1.179.5",
|
||||
"homepage": "https://ghostfol.io",
|
||||
"license": "AGPL-3.0",
|
||||
"scripts": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user