Answers for "force https nuxt heroku"

0

force https nuxt heroku

// Nuxt @ v2.15.6
// 1. Install redirectSSL
npm i redirect-ssl

// 2. Import package in nuxt.config.js
import redirectSSL from 'redirect-ssl';

// 3. Add redirect to nuxt.config.js (make sure you have environment variables in Heroku)
export default {
   ...
   serverMiddleware: [
     redirectSSL.create({enabled: process.env.NODE_ENV === 'production'})
   ],
   ...
}
Posted by: Guest on September-21-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language