8000 GitHub - joaopclima/ssl-express-www: Force SSL when HTTP is required. Remove www and trailing slash on domain.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

joaopclima/ssl-express-www

 
 

Repository files navigation

Force SSL using Express

Force SSL (HTTPS) when HTTP is required using Express (Nodejs). Remove www and trailing slash on domain.

project-version downloads npm mocha Build Status

Installation

npm i ssl-express-www

Usage CommonJS

var express = require('express');
var secure = require('ssl-express-www');
var app = express();

app.use(secure);

var port = process.env.PORT || 3000;
app.listen(port, () => console.log('Server listening.'));

Usage ES6

Transpile it with Babel

import express from 'express';
import secure from 'ssl-express-www';

const app = express();

app.use(secure);

let port = process.env.PORT || 3000;
app.listen(port, () => console.log('Server listening.'));

Solve LF replace to CRLF on Git

This command will solve the problem with linebreak replacement on git commit.

git config --global core.autocrlf input

Contributing

Babel@6 doesn't export default module.exports any more.

npm i -D babel-plugin-add-module-exports

Usage in file .babelrc

{
  "presets": ["env"],
  "plugins": [
    "add-module-exports"
  ]
}

Update package version

View usage | view

npm version patch -m "Bumped to version %s"

v2.1.1

npm version minor

v1.2.1

npm version major

v3.1.1

List global NPM packages

npm list -g --depth 0

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Force SSL when HTTP is required. Remove www and trailing slash on domain.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%
0