Created
December 1, 2015 16:27
-
-
Save nurfarazi/88bdcb269904d66d1686 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set up plain http server | |
var http = express.createServer(); | |
// set up a route to redirect http to https | |
http.get('*',function(req,res){ | |
res.redirect('https://mydomain.com'+req.url) | |
}) | |
// have it listen on 8080 | |
http.listen(8080); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment