node.js - 使用heroku进行端点调用
问题描述
我已经在heroku上部署了我的后端,
https://morning-tor-91556.herokuapp.com/
当转到此链接时,它工作正常,但现在我想调用我的端点/技能,这是我在后端的 nodeJS 中制作的,代码是
app.get("/skills",function(req,res){
Skill.find(function(err,foundSkills){
if(!err){
res.send(foundSkills);
console.log(foundSkills);
}else{
res.send(err);
}
});
});
https://morning-tor-91556.herokuapp.com/skills
但是当我转到此链接时,它只是加载而不是我应该从获取请求中获得的响应,但是如果我转到 localhost:9000/skills,我会根据需要获得我的收藏。
所以知道我能做什么。
解决方案
错误可能在数据库配置中,您应该分享有关它的完整代码。
推荐阅读
- c# - 抽象泛型类的 IncludeBase 自动映射器映射失败
- argon2-ffi - 在 macbook 上安装节点 Argon2 时出现问题
- pandas - 水平表示而不是垂直表示的 csv 数据 - Python Pandas CSV
- javascript - Angular Material Paginator 在检索数据后不允许按下后退按钮
- symfony - 如何使 Symfony 表单中的 DateIntervalType 字段不需要
- reactjs - 将 reader.onload 中的字符串传递给父级
- string - 你如何在 Nim 中使用变量进行字符串插值?
- ros - ROS 控制和 Gazebo 的问题
- ruby-on-rails - X时间过去后如何使Ruby超时HTTP请求
- paraview - 在后台使用 ParaView API 构建桌面应用程序