Skip to content

Commit 1be4646

Browse files
zehuac2innocenzi
andauthored
docs: improve instruction for backend integration, close #7778 (#8103)
Co-authored-by: Enzo Innocenzi <enzo@innocenzi.dev>
1 parent b2c029a commit 1be4646

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/guide/backend-integration.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ If you need a custom integration, you can follow the steps in this guide to conf
3636
<script type="module" src="http://localhost:3000/main.js"></script>
3737
```
3838

39-
Also make sure the server is configured to serve static assets in the Vite working directory, otherwise assets such as images won't be loaded properly.
39+
In order to properly serve assets, you have two options:
40+
41+
- Make sure the server is configured to proxy static assets requests to the Vite server
42+
- Set [`server.origin`](https://vitejs.dev/config/#server-origin) so that generated asset URLs will be resolved using the back-end server URL instead of a relative path
43+
44+
This is needed for assets such as images to load properly.
4045

4146
Note if you are using React with `@vitejs/plugin-react`, you'll also need to add this before the above scripts, since the plugin is not able to modify the HTML you are serving:
4247

0 commit comments

Comments
 (0)