How to route using XMLHttpRequest (js) and "pure" NodeJS?
I am setting up a server using Node and hosting a HTML file "index.html" with "script.js" on localhost. My client-side code looks like: https://code.sololearn.com/WP3yos46EDwb/#html And, I'm handling the ajax request using my server-side script "server.js" which I've learnt from https://developer.mozilla.org/en-US/docs/Learn/Server-side/Node_server_without_framework#Example - It is really a good source :) After doing all these things, my hosted site runs very well. But, the only problem I face is routing programmatically. When, I type localhost:8125/login.html - it routes exactly as I wished but, when I try the same through my ajax request. It does everything, EXCEPT routing :| Please help me to solve this problem. Thanks in advance!