Browse Source

Rename middleware

pull/2239/head
Thomas 2 years ago
parent
commit
bc0c82ef6b
  1. 4
      apps/api/src/main.ts
  2. 2
      apps/api/src/middlewares/html-template.middleware.ts

4
apps/api/src/main.ts

@ -7,7 +7,7 @@ import helmet from 'helmet';
import { AppModule } from './app/app.module'; import { AppModule } from './app/app.module';
import { environment } from './environments/environment'; import { environment } from './environments/environment';
import { StaticMiddleware } from './middlewares/static.middleware'; import { HtmlTemplateMiddleware } from './middlewares/html-template.middleware';
async function bootstrap() { async function bootstrap() {
const configApp = await NestFactory.create(AppModule); const configApp = await NestFactory.create(AppModule);
@ -53,7 +53,7 @@ async function bootstrap() {
); );
} }
app.use(StaticMiddleware); app.use(HtmlTemplateMiddleware);
const BASE_CURRENCY = configService.get<string>('BASE_CURRENCY'); const BASE_CURRENCY = configService.get<string>('BASE_CURRENCY');
const HOST = configService.get<string>('HOST') || '0.0.0.0'; const HOST = configService.get<string>('HOST') || '0.0.0.0';

2
apps/api/src/middlewares/static.middleware.ts → apps/api/src/middlewares/html-template.middleware.ts

@ -89,7 +89,7 @@ const isFileRequest = (filename: string) => {
return filename.split('.').pop() !== filename; return filename.split('.').pop() !== filename;
}; };
export const StaticMiddleware = async ( export const HtmlTemplateMiddleware = async (
request: Request, request: Request,
response: Response, response: Response,
next: NextFunction next: NextFunction
Loading…
Cancel
Save