David Geronimo
David Geronimo

Reputation: 17

Restheart: mongodb thgourh http get returns 404

I have managed to access a static url but when it comes to accessing an existing collection in mongodb (2.6) through a browser (e.g., http://0.0.0.0:8080/test/test) it returns a 404. Anybody knows if I have to add anything to the default configuration.yml to activate mongo access?

Thanks for help!!

Upvotes: 0

Views: 636

Answers (2)

David Geronimo
David Geronimo

Reputation: 17

Finally I managed to find what the problem was by myself. I post the answer in case it's helpful for somebody else. Thanks Andrea for the help in any case :)

In the static-resources-mounts I had "where: /", which seemed to collide with the mongo-mounts default own "where: /". By changing either where value the access to mongodb retrieves a correct hal+json.

Upvotes: 1

Andrea Di Cesare
Andrea Di Cesare

Reputation: 1253

First make sure it is RESTHeart responding you request: if it is running on your pc, try 127.0.0.1:8080/test/test (not 0.0.0.0)

Also note that in case of 404, you should get a hal+json document with a "message" property (with somenthing like "the db test does bot exist").

If it is restheart, then either the db "test" or the collection "test/test" does not exist an you have to create them first.

If restheart coudn't connect with mongodb you would get "400 Internal Server Error" response code.

Upvotes: 2

Related Questions