Gettting Page not found, Initial connect to db do not work?
See original GitHub issueHello, i tried using this plugin with no succes
i have got this function
const service = function() {
const app = this;
MongoClient.connect("mongodb://localhost:27017/feathers").then(client => {
const db = client.db("EaCms");
app.use(
"/news",
service({
Model: db.collection("news")
})
);
});
}
const app = feathers()
app
.configure(hooks())
.configure(rest())
.configure(service)
.configure(middleware);
export deafault app;
and i am getting
{
"name": "NotFound",
"message": "Page not found",
"code": 404,
"className": "not-found",
"errors": {}
}
i tried doing this - commenting the connect part
const service = function() {
const app = this;
/*
MongoClient.connect("mongodb://localhost:27017/feathers").then(client => {
const db = client.db("EaCms");
app.use(
"/news",
service({
Model: db.collection("news")
})
);
});*/
app.use("/testmongdb", function(req, res) {
res.send(JSON.stringify(true));
});
}
and i get the true response.
how use this plugin? what am i missing? is it because of connect that is async?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
php - encounter ERROR 404 url not found when establishing ...
I'm creating a signup page, when I add required fields to establish database connections in the beginning of the body of my signup ......
Read more >How To Fix The "Error Establishing a Database Connection" in ...
The entire page is blank because no data can be retrieved to render the page, as the connection is not working properly. Not...
Read more >How to Fix Error Establishing a Database Connection Error
The error establishing a database connection error basically means that for some reason or another the PHP code was unable to connect to...
Read more >How to Fix the Error Establishing a Database Connection in ...
The 'Error establishing a database connection' issue can be caused by incorrect database information in your WordPress settings, corrupt ...
Read more >A "Error 404" error is encountered when linking a database to ...
A “Error 404” error is encountered when linking a database to Team Foundation Server in a different domain from the host · Close...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
See https://github.com/feathersjs/feathers/issues/757. http://localhost:3000/api/news/5a43c1e1162dea5dc8a264dd should work though.
Ohhh i missed this. thanks! Now it is working, before closing. Using postman http://localhost:3000/api/news <- this working http://localhost:3000/api/news?id=5a43c1e1162dea5dc8a264dd <- this is not working return [ ] http://localhost:3000/api/news?test=test<- this is working
http://localhost:3000/api/news/5a43c1e1162dea5dc8a264dd <- neither this working it return this
do i have to do something else or this bug of lib?