Skip to main content

How to add encryption (https) to your JavaScript application

· One min read

I hadn’t given too much thought to encrypting the traffic to my applications, until developing for 3rd party services like Facebook Messenger or using service workers require your server to use https.

For a full stack JavaScript application we need to setup encrypt on both the front-end and the back-end.

Front-End Encryption

I’m serving my files (fonts, HTML, JS) over Apache on Ubuntu 16.04 on DigitalOcean.

Today I setup encryption for I already had setup the Virtual Host for this domain. To add encryption I followed this guide to Secure Apache with Let’s Encrypt.

It was as simple as..

apt-get update

apt-get install python-letsencrypt-apache

letsencrypt --apache -d

I then answered a prompt on choosing to get all traffic redirected to https. And that’s it!