How to setup a proxy with "brunch watch" ? #1870
Replies: 4 comments
-
|
If you are planning to handle this separately in your production environment, then you can follow the instructions here: http://brunch.io/docs/config#-server- to create a separate |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the tip, but it doesn't seem to work. Do you have any idea why this doesn't work ? Logs : If I call http://localhost:8080\myApi\myService by myself I have a correct answer. My brunch-server.js file is : staticProxy = require('static-proxy');
exports.startServer = (port, path, callback) => {
staticProxy('localhost:8080/myApi/', port, 'http', [path], true, transform);
};My config.coffee file is : exports.config =
server:
path: 'brunch-server.js'
port: 3333
run: yes |
Beta Was this translation helpful? Give feedback.
-
|
We actually don't support older Brunches. Try migrating to |
Beta Was this translation helpful? Give feedback.
-
|
Oh yea, I didn't even notice the Brunch 1 reference. That would be the first thing to try. Also if you aren't invoking |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I would like to setup a proxy when my server is running with "brunch watch" command. The aim is to allow my webapp to communicate with a REST API written with Java and running on localhost:8080
Today, my webapp is running on localhost:3333
When I call "GET api/myService" I would like the server to call "GET localhost:8080/api/myService" instead of "GET localhost:3333/api/myService"
How can I do that with brunch ?
Thanks for your help
package.jsoncontentsbrunch config contents
Beta Was this translation helpful? Give feedback.
All reactions