NodeJS route changes not being updated but new routes work properly

Issue

I need to make some changes in an old legacy code which I don’t know much about, and I’m experiencing something very confusing.

the route is defined like this

app.get('/getMapProduct',billing.getMapProdut);

and I need to change to content being returned in from the function billing.getMapProdut
I changed the logic of the function but calling the route still returns according to the old logic.

I added a new route calling the same function

app.get('/test',billing.getMapProdut);

and it returns like expected, with the new logic.

Next, I’ve tried to change the name of the original function to:

app.get('/getMapProducttt',billing.getMapProdut);

getMapProducttt doesn’t work (not found), the old route still works.

The next try is the most weird to me, I’ve tried adding a new route called getMapProducttt, but unlike test, this one didn’t work. Yet, adding a route called getMapProd does work like test.

Next, I’ve tried commenting out the original route, but, you guessed it, still works.
I’ve also tried changing the name of the entire file containing all of the routes. The ‘test’ one doesn’t work anymore, but the ‘getMapProduct’ still works.

I’ve searched the entire codebase, there’s no other definition of a route called getMapProduct, and no other definition of the function being called from it, getMapProdut.

The only direction I’m able to think of is some sort of weird cache mechanism, but I can’t think of where or how is it defined.

I’m afraid it might be something really silly, but I can’t think of anything. any ideas?

Solution

This was eventually really silly, though still some of the scenarios that happened aren’t clear to me. It was a weirdly setup cache on the CloudFront

Answered By – MatanyaP

Answer Checked By – Marie Seifert (AngularFixing Admin)

Leave a Reply

Your email address will not be published.