Skip to content
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

move search endpoint to netlify #15119

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Conversation

vkarpov15
Copy link
Collaborator

Summary

I refactored https://github.com/mongoosejs/backend to run on Netlify functions because I was having a lot of trouble with deploying to Azure Functions. Netlify's automatic CI/CD should make it much easier to maintain the backend going forward.

I will have to make this change in other branches. However not urgent - the Azure Functions endpoint is still running and up to date, I just had to make some changes to our GitHub webhook re: #15117 so that's the only code that's out of date.

Examples

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

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

Looks good to me, though is when going directly to that endpoint(/.netlify/functions) supposed to show "Page not found" (though adding /search gives a parameter error)?
Also when trying to run this locally, it seem to not work with the error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://mongoose-js.netlify.app/.netlify/functions/search?search=model&version=8.x. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

@hasezoey hasezoey added the docs This issue is due to a mistake or omission in the mongoosejs.com documentation label Dec 19, 2024
@vkarpov15
Copy link
Collaborator Author

Thanks for catching that, there was a CORS issue on mongoosejs/backend that I fixed. Seems to work fine now, I can fetch() the search endpoint from Chrome console on mongoosejs.com as shown in the following screenshot.

image

@hasezoey
Copy link
Collaborator

Can confirm that it also now works when using doc:view and trying to search from a local build. (instead of searching from mongoosejs.com)

@vkarpov15 vkarpov15 added this to the 8.9.3 milestone Dec 19, 2024
@vkarpov15 vkarpov15 merged commit 8acb95b into master Dec 19, 2024
2 checks passed
@hasezoey hasezoey deleted the vkarpov15/update-search-endpoint branch December 20, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants