Tell us what’s happening:
image preview show only the text CANNOT GET?
Your code so far
My codes are as shown in the image attached to this post
. I passed all the steps but why the image only show the text “CANNOT GET”? Is my code correct or have missing information?
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 OPR/94.0.0.0
Challenge: Information Security with HelmetJS - Hash and Compare Passwords Synchronously
Link to the challenge:
Please post your actual code instead or pictures. Thanks
Cannot GET /
(mind the /
) at the end, means that you have no server listening at the route /
which is the path that your request “waiting for”.
If you put url/hello
it will tell you Cannot GET /hello
, because there isn’t either a server at that route.
So at the moment, what you have in the server.js
is a piece of code that will run but not returning anything to the user (apart from that default express message), or even has a route defined.
I don’t know what exercise is this but you will likely need some app.get('/', (req,res) => { /* do stuff */ } )
Thanks for the info but I still cannot understand what you mean in your last sentence. Maybe after I finish the tutorial part that explain
how to get this app.get(‘/’, (req,res) => { /* do stuff */ } ) and why I need it, only then I understand what you mean.