Skip to content
This repository has been archived by the owner on Apr 7, 2019. It is now read-only.

Commit

Permalink
dynamic backend proxy
Browse files Browse the repository at this point in the history
start with:
# node proxy.js http://my.server/map
  • Loading branch information
naturefreshmilk committed Dec 18, 2018
1 parent 9a25255 commit 8b9f7e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion proxy.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@

const host = process.argv[2]; // host, for example: https://pandorabox.io/map
//TODO: argument parser, more options: port, debug,e etc

console.log("Creating proxy-connection for backend @ " + host);

var httpProxy = require('http-proxy'),
http = require("http"),
serveStatic = require('serve-static'),
connect = require('connect');


var proxy = httpProxy.createProxy({
target: "https://pandorabox.io/map",
target: host,
secure: false
});

Expand Down

0 comments on commit 8b9f7e6

Please sign in to comment.