ProxyOptions¶
data class ProxyOptions(
val url: String,
val target: String,
val changeOrigin: Boolean,
val ws: Boolean,
val replacePrefixBy: String?
) : Serializable
Configures the proxies started by the Vite development server.
Example¶
External resources¶
See also¶
Constructors¶
ProxyOptions¶
Properties¶
changeOrigin¶
val changeOrigin: Boolean
replacePrefixBy¶
val replacePrefixBy: String?
A path section that replaces the captured url.
Example¶
Then, a GET /foo is proxied to GET http://localhost:4567/bar.
target¶
url¶
The path that should be intercepted by the proxy.
Example¶
vite {
server {
proxy("/foo", "http://localhost:4567")
// The URL can also be declared as a regex:
proxy("^/fallback/.*", "http://jsonplaceholder.typicode.com", changeOrigin = true)
}
}