This is purely for development purpose. Fox example during development of an angular app I would like to proxy the static resources to the angular instance that is running on say port 4200. While my spark app continues to run on the default port.
This will allow me to serve the static content by avoiding problems such as session and CROS while still being able to take advantage of webpack.
Could anybody offer any suggestions or alternatives. Thinking of something on the following front :
port(80);
// define api routes here
// if no match then forward to proxy
get("/*", (req, res) -> {
// forward (not redirect) the requests to localhost 4200
});
post("/*", (req, res) -> {
// forward (not redirect) the requests to localhost 4200
});
// also consider sockets
I am trying to create a proxy server using spark.
This is purely for development purpose. Fox example during development of an angular app I would like to proxy the static resources to the angular instance that is running on say port 4200. While my spark app continues to run on the default port.
This will allow me to serve the static content by avoiding problems such as session and CROS while still being able to take advantage of webpack.
Could anybody offer any suggestions or alternatives. Thinking of something on the following front :