• Register
0 votes
2.4k views

Problem :

When I try to open the terminal and enter the following command:

sudo mongod

The output is received as below:

[initandlisten] waiting for connections on port 27017

When I try to open another terminal and enter following command:

sudo mongo

I will open the mongo shell and prompt me for mongo commands, but when I open the

localhost/27017 I receive the following message:

It looks like you are trying to access MongoDB over HTTP on the native driver port.

I have created a simple nodejs application using the express and when I try to POST data it seems that the mongodb gets hung up. This is the message which I generally receive in the terminal in which I try to start my express application and my page never posts the data. So I think my problem lies within mongo but I am unable to figure it out.

POST /info 200 120002ms
7.5k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

Before the Mongo 3.6:

You could start mongodb with below command :

mongod --httpinterface

And could access it on

http://localhost:28017

But from version 2.6: MongoDB disabled the HTTP interface by default.

The MongoDB 3.6 removed the deprecated HTTP interface and the REST API to MongoDB.

38.6k points