HTTPs with expressjs staticFile for SPA HTTPs with expressjs staticFile for SPA express express

HTTPs with expressjs staticFile for SPA


Good practice is to host node.js applications under proxy (like nginx which is commonly used for this case) because you can't start node.js application on 80 / 443 port without root privileges (and using sudo for it is security issue).

With this in mind - this proxy is the best way for https setup. For example here is step-by-step tutorial for securing nginx with letsencrypt under ubuntu. You can find similar tutorials for your OS and other web servers.