I have over 20 years experience in PHP programming, started and tried to learn Node Js in almost half year, but still not yet understanding how to use it…
I saw many samples on learning Node Js with ExpressJs, which is a framework can be served a website/app on a port (e.g. 3000). But, would there a way working without ExpressJs? I tried to upload that files directly to server, but it turned out loading index.html, not index.js
I also tried to call it as Module in my existing html file, but while calling ‘import’ it fire an error
Relative module specifiers must start with “./”, “../” or “/”.
Since I don’t want to separate main site (:80) and node js (:3000) to different sites, how can I get it work together? Do I need to rewrite whole the existing website (in PHP) to node js and map :3000 to :80 for that?
Is it a general way most node js app running?
Thanks so much.