3

during development, I'd like to use an already existing test server, this server uses apache, so I basically used mod_proxy to proxy it to a subdirectory of my server, let's say http://myserver/myreactapp/ Problem is, I didnt find a way to tell the development server that the js shouldnt be in

<script type="text/javascript" src="/static/js/bundle.js"></script></body>

but in

<script type="text/javascript" src="/myreactapp/static/js/bundle.js"></script></body>

or more logically, in a relative path. I found this option for the build, but not the development server. what is a good way of achieving that ?

beauchette
  • 1,046
  • 2
  • 13
  • 31

1 Answers1

2

If you use nginx, you can use alias like this:

location /static/ {
  alias /myreactapp/static/;
}

If you use apache, the alias syntax is:

Alias "/static" "/myreactapp/static"
oklas
  • 7,935
  • 2
  • 26
  • 42
  • 1
    It works, but I'll have to find another solution soon, because my goal is to have more than one app proxied, so more than one static directory ^^ – beauchette Feb 22 '18 at 09:22