Skip to content

Express middleware for only accept secure requests (i.e. HTTPS requests)

License

Notifications You must be signed in to change notification settings

talyssonoc/express-secure-only

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

secure-only

Express middleware for only accept secure requests (i.e. HTTPS requests)

Example

	var secureOnly = require('secure-only');
	app.get('/login', secureOnly([options]));

Options

  • redirect: URL to where the user will be redirected if using a non-secure request (default: false)
  • status: If using redirect, redirect it with this status. Otherwise, send a response with this status (default: 302 for redirect, 404 for body)
  • body: If not using redirect, send a response with this body (default: 'Not found' or the http.STATUS_CODE for the given status)

About

Express middleware for only accept secure requests (i.e. HTTPS requests)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published