We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd671dd commit ab6ca7dCopy full SHA for ab6ca7d
forwarder.js
@@ -1,7 +1,10 @@
1
var http = require('http'),
2
+ url = require('url'),
3
port = process.env.PORT || 3000;
4
http.createServer(function (req, res) {
- res.writeHead(301, {'Location': process.env.LOCATION});
5
+ var path = url.parse(req.url).pathname || "";
6
+
7
+ res.writeHead(301, {'Location': process.env.LOCATION + path});
8
res.end();
9
}).listen(port, function(){
10
console.log("Forwarder started on port " + port);
0 commit comments