Skip to content

Conversation

@jempa182
Copy link

@jempa182 jempa182 changed the title Mongo API - Jenny A Project Mongo API - Jenny A Dec 15, 2024
Copy link
Contributor

@HIPPIEKICK HIPPIEKICK left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 💯

@jempa182
Copy link
Author

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 😊

Copy link
Contributor

@HIPPIEKICK HIPPIEKICK left a 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 });
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants