June 2025
Intermediate to advanced
837 pages
24h 50m
English
Because Express is based on the HTTP module of Node.js, the framework is quite flexible when it comes to exchanging the communication protocol.
Instead of HTTP, you can also use the secure HTTPS variant recommended for productive applications. For this, you don’t need to do anything more than pass the app object you created by calling the express function to the createServer method of the https module.
Listing 6.33 contains the necessary customizations to deliver your movie database with HTTPS. The example assumes that you’ve issued yourself a self-signed certificate and saved the files in the cert directory as in Chapter 5, Section 5.3. When you restart the server after these adjustments, you can reach ...
Read now
Unlock full access