Skip to content

Commit

Permalink
Make vite tool shed client proxy configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Oct 14, 2024
1 parent 6dc681d commit 6e6e04c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
21 changes: 21 additions & 0 deletions lib/tool_shed/webapp/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Tool Shed 2.0 client

The following assumes `npx` is installed, but equivalent npm commands should work too.

To start a HMR dev server run

```shell
npx vite dev
```

Note that you will need to start the Tool Shed backend from the galaxy root directory:

```shell
TOOL_SHED_API_VERSION=v2 ./run_tool_shed.sh
```

If you want to target an external V2 tool shed API run

```shell
TOOL_SHED_URL=https://testtoolshed.g2.bx.psu.edu CHANGE_ORIGIN=true npx vite dev
```
8 changes: 3 additions & 5 deletions lib/tool_shed/webapp/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ export default defineConfig({
server: {
proxy: {
"/api": {
// This is the URL of the backend server
// The address is the default when running `make run_test_backend`
target: "http://127.0.0.1:9009/",
changeOrigin: true,
secure: false,
target: process.env.TOOL_SHED_URL || "http://127.0.0.1:9009",
changeOrigin: process.env.CHANGE_ORIGIN ? !process.env.CHANGE_ORIGIN : true,
secure: !process.env.CHANGE_ORIGIN,
},
},
},
Expand Down

0 comments on commit 6e6e04c

Please sign in to comment.