I get the following error from the freeCodeCamp page:
// running test
expected ‘Express’ to not equal ‘Express’
// tests completed
I’m inclined to think I’ve made a mistake rather than there being a glitch, but I copy and pasted the code from the module’s page on github. I’ve tried using a few different versions of the package, but no luck there.
I mentioned it above, but coming back to the same challenge two days later, the code ran and passed the test on the first try. I ran it 2-3 more times to make sure it’s not a fluke. Maybe something got updated in the intervening time?
I will keep your comments in mind though for future problems!
I had the same issue. I just reloaded my Glitch page and then reloaded the site preview. Once I did that, the URL passed the test.
However, I went to view the headers after adding that code and I’m still able to see the “x-powered-by: Express” header within Chrome dev tools. Any ideas on why this is the case? Is it because the tools are picking up that Glitch is powered by Express perhaps?
I just completed this challenge and wanted to add my experience to help others who may have difficulty.
Despite many reloads, I was unable to set the “x-powered-by” field in the header to nothing using helmet.hidePoweredBy().
I had to set the “x-powered-by” field to something else in order to pass the freeCodeCamp challenge. I used helmet.hidePoweredBy({ setTo: ‘PHP 4.2.0’ }) to make it appear as an Apache server.
Thank you. I tried this code in myApp.js and while “x-powered-by” header changed correctly the error "expected ‘Express’ to not equal ‘Express’
" remains. Could you please guide?
let helmet = require(‘helmet’);
app.use(helmet.hidePoweredBy({ setTo: ‘PHP 4.2.0’ }));
Same with me… Was juuuuust about to be frustrated when I thought I better come in here and see if anyone is having buggy issues… reloaded glitch, relaunch the site preview, and it passed…
If the same exercise with the same code is ran in Mozilla Firefox the test cases pass, so I believe this one is yet another challenge which does not work on Chrome as I was getting the same issue on Chrome
I had a similar problem with this challenge using the VsCode Glitch plugin (which is super nice!). even though myApp.js code reflected the changes in VScode I had to refresh the glitch project page, and then submit the Live URL, it worked then with