Skip to content

Commit

Permalink
Use http-proxy-middleware instead of cors-anywhere
Browse files Browse the repository at this point in the history
Part of #755
  • Loading branch information
jirik committed Feb 23, 2023
1 parent 9d4a65e commit a60e30f
Show file tree
Hide file tree
Showing 11 changed files with 1,071 additions and 451 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ make timgen-build
- [#703](https://github.com/LayerManager/layman/issues/703) Attribute names in [WFS-T requests](doc/endpoints.md#web-feature-service) must match to regex `^[a-zA-Z_][a-zA-Z_0-9]*$`, otherwise Layman error is raised. It applies to attributes of both internal and external tables, and only to attributes that not exist in database yet.
- [#772](https://github.com/LayerManager/layman/issues/772) Speed up endpoints [GET Workspace Layer Thumbnail](doc/rest.md#get-workspace-layer-thumbnail), [GET Workspace Layer Style](doc/rest.md#get-workspace-layer-style), [GET Workspace Map Thumbnail](doc/rest.md#get-workspace-map-thumbnail) and [GET Workspace Map File](doc/rest.md#get-workspace-map-file).
- [#755](https://github.com/LayerManager/layman/issues/755) Downgrade Node.js of Timgen from v18 to v16
- [#755](https://github.com/LayerManager/layman/issues/755) Change Node.js dependencies of Timgen:
- http-server -> express 4
- cors-anywhere -> http-proxy-middleware 2

## v1.19.0
2023-01-11
Expand Down
4 changes: 2 additions & 2 deletions doc/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
| --- | --- | --- | --- | --- | --- |
| [layman-test-client](https://github.com/LayerManager/layman-test-client) | GNU GPL v3 | client/docker/Dockerfile | opt | bin | to demonstrate communication with REST API |
| [openlayers](https://openlayers.org/) | BSD 2-Clause | timgen/package.json | prod | bin | for client-side map rendering in Timgen |
| [http-server](https://www.npmjs.com/package/http-server) | MIT | timgen/package.json | prod | bin | as static HTTP server for Timgen |
| [cors-anywhere](https://www.npmjs.com/package/cors-anywhere) | MIT | timgen/package.json | prod | bin | for proxying Timgen requests |
| [express](https://expressjs.com/) | MIT | timgen/package.json | prod | bin | as HTTP server for Timgen |
| [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) | MIT | timgen/package.json | prod | bin | for proxying Timgen requests |
| [file-saver](https://www.npmjs.com/package/file-saver) | MIT | timgen/package.json | prod | bin | for saving images in Timgen |

## Other dependencies
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ services:
dockerfile: Dockerfile.production
image: timgen:latest
user: ${UID_GID}
command: sh -c "node proxy.js & npx http-server dist/"
command: sh -c "node server.js"
extra_hosts:
- ${EXTRA_HOST1}
- ${EXTRA_HOST2}
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ services:
dockerfile: Dockerfile.production
image: timgen:latest
user: ${UID_GID}
command: sh -c "node proxy.js & npx http-server dist/"
command: sh -c "node server.js"
# ports:
# - 8080:8080
# - 8081:8081

layman_client:
container_name: layman_client
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ services:
dockerfile: Dockerfile.production
image: timgen:latest
user: ${UID_GID}
command: sh -c "node proxy.js & npx http-server dist/"
command: sh -c "node server.js"
# ports:
# - 8080:8080
# - 8081:8081

layman_client_test:
container_name: layman_client_test
Expand Down
2 changes: 1 addition & 1 deletion timgen/Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN npm ci

ADD index.html \
index.js \
proxy.js \
server.js \
/code/

ADD src /code/src
Expand Down
Loading

0 comments on commit a60e30f

Please sign in to comment.