Skip to content

An extension for Directus that adds some middleware in production to force SSL (detection using headers from Heroku)

License

Notifications You must be signed in to change notification settings

formrausch/directus-extension-force-ssl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uses the X-Forwarded-Proto header provided by reverse proxies like Heroku to decide whether to redirect the user's request to HTTPS. Only does something if the underlying Directus Express environment is set to production, which by default is set via a NODE_ENV environment variable.

Setup

  1. yarn

Build

yarn run build

Install

Copy the output of dist/ after running the build command into your Directus project under ./extensions/hooks/force-ssl/.

Developing

npx directus-extension build -o /path/to/your/directus/extensions/hooks/force-ssl/index.js  -w

Extension behaviour is dependent on NODE_ENV so you may also need to tweak your .env or environment variables to get it to do anything in development.

About

An extension for Directus that adds some middleware in production to force SSL (detection using headers from Heroku)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%