Skip to content

Commit

Permalink
Merge pull request #353 from smoothdeveloper/gauthier/routing-vite-pr…
Browse files Browse the repository at this point in the history
…oxy-config-sample

add a note for vite users in the custom route path doc.
  • Loading branch information
Zaid-Ajaj authored Nov 30, 2023
2 parents fd3b3b3 + 5adc965 commit 2365dac
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
17 changes: 17 additions & 0 deletions docs/advanced/custom-route-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,21 @@ devServer: {
changeOrigin: true
}
}
```
If you happen to use [`vite-js`](https://vitejs.dev/config/server-options.html#server-proxy), here is the equivalent, to put in the `vite.config.ts:
```js {highlight: [7,8,9,10,11]}
import { defineConfig } from 'vite'
export default defineConfig({
server: {
host: '0.0.0.0'
, port: 5173
, proxy: {
'/api': {
target: 'http://localhost:5000',
changeOrigin: true
}
}
}
})
```
30 changes: 15 additions & 15 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"live-server": "^1.2.1"
"live-server": "^1.2.2"
},
"dependencies": {
"mime-db": "^1.52.0"
Expand Down

0 comments on commit 2365dac

Please sign in to comment.