mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
sample(): Fix samples build processes
This commit is contained in:
@@ -3,7 +3,7 @@ import { Injectable, NestMiddleware } from '@nestjs/common';
|
||||
@Injectable()
|
||||
export class LoggerMiddleware implements NestMiddleware {
|
||||
use(req: any, res: any, next: () => void) {
|
||||
console.log(`[${context}] Request...`);
|
||||
console.log(`Request...`);
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "**/*.spec.ts"]
|
||||
"exclude": ["node_modules", "**/*.spec.ts"],
|
||||
"compilerOptions": {
|
||||
"types": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,11 +20,13 @@
|
||||
"class-validator": "0.9.1",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"socket.io-redis": "5.2.0",
|
||||
"typescript": "3.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.6",
|
||||
"@types/socket.io": "2.1.2",
|
||||
"@types/socket.io-redis": "1.0.25",
|
||||
"@types/ws": "6.0.1",
|
||||
"ts-node": "8.3.0",
|
||||
"tslint": "5.18.0"
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"start": "node dist/server",
|
||||
"webpack": "webpack --config webpack.config.js"
|
||||
"dev": "webpack --config webpack.config.js --watch",
|
||||
"build": "webpack --config webpack.config.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.2",
|
||||
@@ -16,7 +17,7 @@
|
||||
"typescript": "3.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "10.14.12",
|
||||
"@types/node": "12.6.0",
|
||||
"ts-loader": "6.0.4",
|
||||
"ts-node": "8.3.0",
|
||||
"tslint": "5.18.0",
|
||||
|
||||
@@ -4,7 +4,6 @@ const nodeExternals = require('webpack-node-externals');
|
||||
|
||||
module.exports = {
|
||||
entry: ['webpack/hot/poll?100', './src/main.ts'],
|
||||
watch: true,
|
||||
target: 'node',
|
||||
externals: [
|
||||
nodeExternals({
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"target": "es6",
|
||||
"sourceMap": true,
|
||||
"outDir": "./dist",
|
||||
"baseUrl": "./"
|
||||
"baseUrl": "./",
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "**/*.spec.ts"]
|
||||
"exclude": ["node_modules", "**/*.spec.ts"],
|
||||
"compilerOptions": {
|
||||
"skipLibCheck": true
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "**/*.spec.ts"]
|
||||
"exclude": ["node_modules", "**/*.spec.ts"],
|
||||
"compilerOptions": {
|
||||
"types": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import { CacheInterceptor, ExecutionContext, Injectable } from '@nestjs/common';
|
||||
import {
|
||||
CacheInterceptor,
|
||||
ExecutionContext,
|
||||
Injectable,
|
||||
} from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
class HttpCacheInterceptor extends CacheInterceptor {
|
||||
trackBy(context: ExecutionContext): string | undefined {
|
||||
const request = context.switchToHttp().getRequest();
|
||||
const httpServer = this.applicationHost.applicationRef;
|
||||
const { httpAdapter } = this.httpAdapterHost;
|
||||
const httpServer = httpAdapter.getHttpServer();
|
||||
|
||||
const isGetRequest = httpServer.getRequestMethod(request) === 'GET';
|
||||
const excludePaths = [];
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "**/*.spec.ts"]
|
||||
"exclude": ["node_modules", "**/*.spec.ts"],
|
||||
"compilerOptions": {
|
||||
"types": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "**/*.spec.ts"]
|
||||
"exclude": ["node_modules", "**/*.spec.ts"],
|
||||
"compilerOptions": {
|
||||
"types": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"target": "es6",
|
||||
"sourceMap": true,
|
||||
"outDir": "./dist",
|
||||
"baseUrl": "./"
|
||||
"baseUrl": "./",
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"target": "es6",
|
||||
"sourceMap": true,
|
||||
"outDir": "./dist",
|
||||
"baseUrl": "./"
|
||||
"baseUrl": "./",
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user