Mongodb webhook gives 404, but not with fetch

Hello everyone, I am trying to reverse engineer and build my own application off of this course here on FCC.

The only problem I am running into is I have my own mongodb collection, and I am trying to connect with it the same way that the teacher does.

//http common file 
export default axios.create({
  headers: {
    "Content-type": "application/json"

my petList.js file

const getPetInfo = () => {
    .then(response => {
    .catch(e => {

this is giving me a 404 error, and I’m not sure why. Interestingly enough why I fetch the data from the url, it will return the data no problem. And I would just use that if I knew how to use this method to do all of the other api calls.

//This one works just fine 
  async function getPetInfo() {
    const response = await fetch('');
    const json = await response.json();
     console.log('this is pets')

If anyone could help me out with this. I’d very much appreciate it.
Thank you in advance.

I forgot to add, my code is here: GitHub - Imstupidpleasehelp/MERN-lesson
And the source lesson code is here: GitHub - beaucarnes/restaurant-reviews

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.