mirror of
https://github.com/Brotocol-xyz/bro-sdk.git
synced 2026-01-12 06:44:18 +08:00
33 lines
936 B
TypeScript
33 lines
936 B
TypeScript
import { defineConfig } from "vite"
|
|
import react from "@vitejs/plugin-react"
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
base: "/bro-sdk-example/cross-chain-swap/",
|
|
server: {
|
|
proxy: {
|
|
"/api/matcha": {
|
|
target: "https://api.0x.org",
|
|
changeOrigin: true,
|
|
rewrite: path => path.replace(/^\/api\/matcha/, ""),
|
|
configure: (proxy, _options) => {
|
|
proxy.on("error", (err, _req, _res) => {
|
|
console.log("proxy error", err)
|
|
})
|
|
proxy.on("proxyReq", (proxyReq, req, _res) => {
|
|
console.log("Sending Request to the Target:", req.method, req.url)
|
|
})
|
|
proxy.on("proxyRes", (proxyRes, req, _res) => {
|
|
console.log(
|
|
"Received Response from the Target:",
|
|
proxyRes.statusCode,
|
|
req.url,
|
|
)
|
|
})
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|