Cannot access mongodb through browser - It looks like you are trying to access MongoDB over HTTP on the native driver port

前端 未结 5 1887
我在风中等你
我在风中等你 2021-01-30 11:09

I open terminal and enter the following commands

sudo mongod

which then outputs

[initandlisten] waiting for connections on port         


        
5条回答
  •  遇见更好的自我
    2021-01-30 11:50

    Like the previous comment mention, the message "It looks like you are trying to access MongoDB over HTTP on the native driver port." its a warning because you are missunderstanding this line: mongoose.connect('mongodb://localhost/info'); and browsing this url: http://localhost:28017/

    However, if you want to see the mongo's admin web page, you could do it, with this command:

    mongod --rest --httpinterface

    browsing this url: http://localhost:28017/

    the parameter httpinterface activate the admin web page, and the parameter rest its needed for activate the rest services the page require

提交回复
热议问题