mirror of
https://github.com/kemko/reproxy.git
synced 2026-01-06 18:25:49 +03:00
Multiple static location (#36)
* add isStatic flag to mapper, implement for file and static providers * handle static match response as a special case * move assets conversion to load time * rename static to assets everywhere for consistency * don't overwride asset param in url mapper * add documentation about assets mode * add tests
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
run: install
|
||||
whoami -port 8081 -name=svc1 &
|
||||
whoami -port 8082 -name=svc2 &
|
||||
whoami -port 8083 -name=svc3 &
|
||||
../../dist/reproxy --file.enabled --file.name=reproxy.yml --assets.location=./web --assets.root=/static
|
||||
pkill -9 whoami
|
||||
echo-http --listen=0.0.0.0:8081 --message=svc1 &
|
||||
echo-http --listen=0.0.0.0:8082 --message=svc2 &
|
||||
echo-http --listen=0.0.0.0:8083 --message=svc3 &
|
||||
../../dist/reproxy --file.enabled --file.name=reproxy.yml --assets.location=./web --assets.root=/static --dbg --logger.stdout
|
||||
pkill -9 echo-http
|
||||
|
||||
run_assets_only: install
|
||||
../../dist/reproxy --assets.location=./web --assets.root=/
|
||||
|
||||
pkill -9 whoami
|
||||
pkill -9 echo-http
|
||||
|
||||
kill:
|
||||
pkill -9 whoami
|
||||
pkill -9 echo-http
|
||||
|
||||
install:
|
||||
cd ../../app && CGO_ENABLED=0 go build -o ../dist/reproxy
|
||||
cd /tmp && go install github.com/traefik/whoami@latest
|
||||
cd /tmp && go install github.com/umputun/echo-http@latest
|
||||
|
||||
@@ -3,3 +3,4 @@ default:
|
||||
- {route: "/api/svc2", dest: "http://127.0.0.1:8082/api", "ping": "http://127.0.0.1:8082/health"}
|
||||
localhost:
|
||||
- {route: "^/api/svc3/(.*)", dest: "http://localhost:8083/$1","ping": "http://127.0.0.1:8083/health"}
|
||||
- {route: "/www", dest: "web2", "static": y}
|
||||
|
||||
1
examples/file/web2/1.html
Normal file
1
examples/file/web2/1.html
Normal file
@@ -0,0 +1 @@
|
||||
1.html web2
|
||||
1
examples/file/web2/index.html
Normal file
1
examples/file/web2/index.html
Normal file
@@ -0,0 +1 @@
|
||||
index web2
|
||||
Reference in New Issue
Block a user