8000 docs(proxy): add warning when proxy set as string (fix #3308) (#3320) · vuejs/vue-cli@9be9b6c · GitHub
[go: up one dir, main page]

Skip to content

Commit 9be9b6c

Browse files
lbogdanNataliaTepluhina
authored andcommitted
docs(proxy): add warning when proxy set as string (fix #3308) (#3320)
1 parent 3289e10 commit 9be9b6c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/config/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@ See [the plugin's README](https://github.com/vuejs/vue-cli/blob/dev/packages/%40
338338

339339
This will tell the dev server to proxy any unknown requests (requests that did not match a static file) to `http://localhost:4000`.
340340

341+
::: warning
342+
When `devServer.proxy` is set to a string, only XHR requests will be proxied. If you want to test an API URL, don't open it in the browser, use an API tool like Postman instead.
343+
:::
344+
341345
If you want to have more control over the proxy behavior, you can also use an object with `path: options` pairs. Consult [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware#proxycontext-config) for full options:
342346

343347
``` js

0 commit comments

Comments
 (0)
0