-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
project-mongo-api - Mai #499
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done Mai! I love how you implemented try...catch block to every endpoint, this shows you really paid attention to error handling.
Yet I encountered some errors when accessing your endpoints. "/avocade-sales" leads to 500 error. Could you kindly look into that? Might be deploy error...
server.js
Outdated
expressListEndpoints(app).map((endpoint) => ({ | ||
method: endpoint.methods.join(", "), | ||
path: endpoint.path, | ||
description: "Describe what each endpoint does", // Consider adding more detailed descriptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you going to add the description for each endpoint? Currently it shows the same thing...
// List all sales | ||
app.get("/avocado-sales", async (req, res) => { | ||
try { | ||
const sales = await AvocadoSales.find().select("-_id -__v").sort({ id: 1 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice implement of select method!
yet this endpoint leads to error... which shows error code 500
Netlify link
https://project-mongo-api-ude1.onrender.com/