简体   繁体   English

平均应用程序登录不适用于heroku

[英]Mean app login not working on heroku

I have followed many tutorials on how to get mongodb and MEAN to work on heroku, and none of them have worked for me, I keep getting the 503 application error.我已经学习了很多关于如何让 mongodb 和 MEAN 在 heroku 上工作的教程,但没有一个对我有用,我不断收到 503 应用程序错误。

First I create the app, I do heroku addons:docs mongolab in the commandline, and after that I check my config and change my code so the mongoose connection is changed to the config string like this: mongoose.connect(process.env.MONGOLAB_URI || mongodb://example:example@ds053312.mongolab.com:53312/todolist');首先我创建应用程序,我在命令行中执行heroku addons:docs mongolab ,然后我检查我的配置并更改我的代码,以便将 mongoose 连接更改为这样的配置字符串: mongoose.connect(process.env.MONGOLAB_URI || mongodb://example:example@ds053312.mongolab.com:53312/todolist'); the second part is just an example, the one I use is the one with my information.第二部分只是一个例子,我使用的就是我的信息。 So after this I push my app to heroku, but when I try to run it, it still gives me the application error, and in f12 it says it's所以在这之后我将我的应用程序推送到 heroku,但是当我尝试运行它时,它仍然给我应用程序错误,并且在 f12 中它说它是

Failed to load resource: the server responded with a status of 503 (Service Unavailable) https://myapp.herokuapp.com/favicon.ico加载资源失败:服务器响应状态为 503(服务不可用) https://myapp.herokuapp.com/favicon.ico

What am I doing wrong?我做错了什么? I have tried everything and none of the tutorials are working for me我已经尝试了一切,但没有一个教程对我有用

EDIT: I have managed to get rid of the error by doing the following:编辑:我通过执行以下操作设法摆脱了错误:

$ git init
$ git add .
$ git commit -m "initial version"

$ heroku apps:create

however, now that my app loads, it appears that the login and sign up features of my app doesn't work, I fill out the sign in/log in form and submit but the page just stays where it is without changing.但是,现在我的应用程序加载后,我的应用程序的登录和注册功能似乎不起作用,我填写了登录/登录表单并提交,但页面只是停留在原处而没有更改。 Is there something else I was supposed to do to get these features to work?我还应该做些什么才能使这些功能正常工作?

I came here because my Heroku - deploy Login wasn't working, but Localhost was.我来到这里是因为我的 Heroku - deploy Login 不起作用,但 Localhost 起作用了。 Turns out I forgot to change the Login POST route.原来我忘了更改登录 POST 路由。

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

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