redirect-https.js/example.js

16 lines
391 B
JavaScript
Raw Normal View History

2015-07-07 23:19:44 +00:00
'use strict';
var http = require('http');
var server = http.createServer();
var port = process.argv[2] || 8080;
server.on('request', require('./')({
port: 8443
, body: 'Redirecting to <a href="{{URL}}">{{HTML_URL}}</a>'
2015-07-07 23:19:44 +00:00
, trustProxy: true // default is false
}));
server.listen(port, function () {
console.log('Listening on http://localhost.daplie.com:' + server.address().port);
});