Skip to content

Commit

Permalink
Merge pull request galaxyproject#18988 from mvdbeek/vite_dev_server_p…
Browse files Browse the repository at this point in the history
…roxy

Make vite tool shed client proxy configurable
  • Loading branch information
mvdbeek authored Oct 15, 2024
2 parents 0dbc039 + 3f2b2ba commit f7ff83c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
23 changes: 23 additions & 0 deletions lib/tool_shed/webapp/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Tool Shed 2.0 client

You will need to start the Tool Shed backend from the galaxy root directory.
This is required if you want to develop against a local tool shed, and if you
plan to make changes to the graphql queries if you want to target a remote tool shed.

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

Start the HMR dev server **and** the graphql dev server

```shell
yarn run dev-all
```

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 yarn vite dev
```

Note that you still need a local backend to generate the graphql schema.
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 f7ff83c

Please sign in to comment.