• Register
0 votes

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
6 5 3
7,540 points

1 Answer

0 votes

Solution :

Before the Mongo 3.6:

You could start mongodb with below command :

mongod --httpinterface

And could access it on


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.

9 7 4
38,600 points

Related questions

1 vote
2 answers 446 views
Problem : I am very new to the Node.js and I am having few issues. I am using the Node.js 4.10 and Express 2.4.3. While trying to execute my code I am receiving below error : Error: Can't render headers after they are sent to the client. ... , scope: 'offline_access,email,user_about_me,user_activities,manage_pages,publish_stream', failedUri: '/noauth' }) ])); realapp.use(realapp.router); }); . . .
asked Dec 12, 2019 alecxe 7.5k points
0 votes
1 answer 1.7K views
Problem : I am just starting coding using the nodejs with express. So I simply did this in my file test.js which is into my folder routes : const myexpress = require('express'); const myrouter = new myexpress.Router(); myrouter.get('/test', (req, res) => { res.send(` ... browser, it tells me it Cannot get/test I don't understand why this is happening to me. Please let me know how can I fix this?
asked Jan 23 jwilliam 3.9k points
0 votes
2 answers 2K views
Problem : Facing following express issue throw new typeerror('router.use() requires a middleware function but got a ' + gettype(fn))
asked Nov 18, 2019 peterlaw 6.9k points
0 votes
1 answer 11 views