简体   繁体   English

为什么在nest.js中配置了控制器后不能拉HTTP请求

[英]why can't I pull HTTP requests after configured controller in nest.js

So, the person who left the company used Nest.js write this server side. 因此,离开公司的人使用Nest.js编写了此服务器端。 He has auth.controller, auth.service,auth.module,auth-token,jwt.strategy and jwt-payload all set up well , and I checked his module, everything is imported and the providers are being set up well. 他已经正确设置了auth.controller,auth.service,auth.module,auth-token,jwt.strategy和jwt-payload ,我检查了他的模块,所有内容都已导入,并且提供程序也已正确设置。

But in front-end I do send HTTP request in any end point, I just always get code 404. even if i wrote a simple end point like this : 但是在前端,我确实在任何端点上发送HTTP请求,我总是总是得到404代码。即使我写了这样一个简单的端点,也是如此:

  *@Get('/meow')
  toMeow(){
    return 'meow';
  }*

in his controller file, I still can't pull any HTTP request. 在他的控制器文件中,我仍然无法拉出任何HTTP请求。

In his other folders controller ,I do can pull the HTTP request well with same address plus the routes 在他的其他文件夹控制器中,我可以用相同的地址加上路由来很好地拉HTTP请求

What's the reason for this? 这是什么原因?

我的同事解决了这个问题,我没有向模块注册jwt.strategy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM