【问题标题】:Firebase Angular app not connecting h NodeJS app on HerokuFirebase Angular 应用程序未连接 Heroku 上的 h NodeJS 应用程序
【发布时间】:2017-04-30 07:10:06
【问题描述】:

我已经在 Heroku 上部署了节点服务器,在 Firebase 上部署了客户端 Angular 应用程序,但我遇到了这个问题。请帮助我摆脱困境。

 Mixed Content: The page at 'https://newone-2754f.firebaseapp.com/#/login' 
 was   loaded over HTTPS, but requested an insecure XMLHttpRequest 
 endpoint    'http://localhost:8080/authenticate'. 
 This request has been blocked; the content   must be served over HTTPS.
  (anonymous) @ angular.js:12011
  sendReq @ angular.js:11776
  serverRequest @ angular.js:11571
  processQueue @ angular.js:16383
 (anonymous) @ angular.js:16399
  $eval @ angular.js:17682
  $digest @ angular.js:17495 
  $apply @ angular.js:17790
  (anonymous) @ angular.js:25890
defaultHandlerWrapper @ angular.js:3497
eventHandler @ angular.js:3485
angular.js:12011 XMLHttpRequest cannot 
load    http://localhost:8080/authenticate. Failed to start loading.
(anonymous) @ angular.js:12011
sendReq @ angular.js:11776
serverRequest @ angular.js:11571
processQueue @ angular.js:16383
(anonymous) @ angular.js:16399
 $eval @ angular.js:17682
 $digest @ angular.js:17495
   $apply @ angular.js:17790
(anonymous) @ angular.js:25890
defaultHandlerWrapper @ angular.js:3497
eventHandler @ angular.js:3485

【问题讨论】:

标签: angularjs node.js heroku firebase


【解决方案1】:

当您部署代码时,似乎 http 请求端点(nodejs api 端点)仍然是本地的。更正端点

 was   loaded over HTTPS, but requested an insecure XMLHttpRequest 
 endpoint    'http://localhost:8080/authenticate'. 
                    ^^^^^^^^^^^^^^^^ // Add heroku app url there
 This request has been blocked; the content   must be served over HTTPS.

【讨论】:

  • 怎么做...我是初学者请帮助我
  • 这个问题是node js还是angular js
  • 不确定是外部服务还是内部 API 端点,如果它在您当前的服务器域中,请仅向 /authenticate 端点发出请求。
  • 这似乎是客户端问题(Angular)。
  • 实际上当我在我的机器上运行客户端服务器时没有错误。但是当我部署到火力基地时,我遇到了问题。 newone-2754f.firebaseapp.com
猜你喜欢
  • 2013-11-30
  • 1970-01-01
  • 2016-01-24
  • 2017-09-27
  • 2014-07-09
  • 2018-10-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多