尝试连接到本地主机时获取“无法获取/":5000 Firebase [英] Getting 'Cannot GET /' when trying to connect to localhost:5000 Firebase
问题描述
我试图在Firebase上运行我的本地主机服务器,但是我继续在浏览器无法获取/"中收到以下消息.我在控制台中看了一眼,上面写着" http://localhost:5000/ 404(未找到) '.
I am trying to get my localhost server on Firebase to work but I am continuing to get the following message in the browser 'Cannot GET /'. I took a look in the console and all it says is 'http://localhost:5000/ 404 (Not Found)'.
我尝试使用"firebase serve"重新运行服务器,但这无济于事. 我再次运行"firebase init",但这也没有帮助. 我通过运行'npm install -g firebase-tools'重新安装了firebase工具,然后再次运行firebase serve仍然一无所获.
I have tried re-running the server using 'firebase serve' and that doesn't help. I ran 'firebase init' again and that didn't help either. I re-installed the firebase tools by running 'npm install -g firebase-tools' and then running firebase serve again and still nothing.
不知道发生了什么,因为它最初在工作.我安装了一些grunt插件,并将我的index.html文件移到了html文件夹下,尽管我在公用文件夹下仍然有一个index.html文件,但仍然显示无法获取/"
Not sure whats going on because it was initially working. I installed some grunt plugins and moved my index.html file under an html folder although I still have an index.html file under the public folder it still says 'Cannot GET /'
我也尝试过在其他浏览器中重启它们等.
I have also tried in different browsers restarting them etc.
我正在使用Mac OS X El Capitan.
I am using a Mac OS X El Capitan.
如果您需要更多信息,请告诉我.预先感谢
Let me know if you need any more info. Thanks in advance
推荐答案
我在友好聊天"教程的scripts
目录中运行firebase serve
时遇到此问题.从父目录启动服务器可使服务器再次按预期工作.
I had this issue running firebase serve
from within the scripts
directory in the "Friendly Chat" tutorial. Starting the server from the parent directory got it working again as expected.
这篇关于尝试连接到本地主机时获取“无法获取/":5000 Firebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!