1// Nuxt @ v2.15.6
2// 1. Install redirectSSL
3npm i redirect-ssl
4
5// 2. Import package in nuxt.config.js
6import redirectSSL from 'redirect-ssl';
7
8// 3. Add redirect to nuxt.config.js (make sure you have environment variables in Heroku)
9export default {
10 ...
11 serverMiddleware: [
12 redirectSSL.create({enabled: process.env.NODE_ENV === 'production'})
13 ],
14 ...
15}
16