apiconnect-cli-publish-bluemix
Version:
Plugin for IBM API Connect Developer Toolkit
22 lines (19 loc) • 757 B
JavaScript
/********************************************************* {COPYRIGHT-TOP} ***
* Licensed Materials - Property of IBM
* 5725-Z22, 5725-Z63, 5725-U33, 5725-Z63
*
* (C) Copyright IBM Corporation 2016, 2017
*
* All Rights Reserved.
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
********************************************************** {COPYRIGHT-END} **/
// Node module: apiconnect-cli-publish-bluemix
module.exports = function() {
return function bluemixHttpRedirect(req, res, next) {
if (typeof process.env.BLUEMIX_REGION !== 'undefined' && !req.secure) {
return res.redirect(307, 'https://' + req.headers.host + req.url);
}
next();
};
};