文章问题导向
如何跨域,设置路径前缀?
如何让网站更加安全?防止跨站脚本攻击,跨站点请求伪造
如何限速?
如果你都有了答案,可以忽略本文章,或去nest学习导图寻找更多答案
跨域,路径前缀,网络安全
第一步:安装
yarn add helmet csurf
第二步:在main.ts中引入使用
import {
NestFactory } from '@nestjs/core';
import {
Logger, ValidationPipe } from '@nestjs/common';
import * as helmet from 'helmet';
import * as csurf from 'csurf';
import {
AppModule } from './app.module';
const