-
Notifications
You must be signed in to change notification settings - Fork 515
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 - Jenny A #517
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.
Code looks good, but there seems to be something wrong with the deployment. Can you please have a look?
const { sorted, gameVersion, lifeStage, category } = req.query; | ||
|
||
try { | ||
// Build query object |
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! 💯
Hi @HIPPIEKICK! I have now checked and apparently I had a Network setting in MongoDB Atlas set so that only my IP adress could view it for some reason.. Very strange though because it worked on Monday. But have updated now and it seems to work now again! Let me know otherwise 😊 |
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.
Thanks Jenny, got it to work now! ⭐
// Get single NPC by ID | ||
app.get("/npcs/:id", async (req, res) => { | ||
try { | ||
const npc = await Npc.findOne({ id: req.params.id }); |
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.
Here you could also use the MongoDB ID
https://project-mongo-api-npcs.onrender.com/