feat(main): use vite's rewrite instead of vercel's
This commit is contained in:
parent
9cc89a1a2a
commit
6d362eb5c4
2 changed files with 10 additions and 9 deletions
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"$schema": "https://openapi.vercel.sh/vercel.json",
|
|
||||||
"rewrites": [
|
|
||||||
{
|
|
||||||
"source": "/stats/:match*",
|
|
||||||
"destination": "https://analytics.umami.is/:match*"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -11,5 +11,15 @@ export default defineConfig({
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
open: true,
|
open: true,
|
||||||
|
proxy: {
|
||||||
|
// https://umami.is/docs/guides/bypass-ad-blockers
|
||||||
|
// https://vitejs.dev/config/server-options.html#server-proxy
|
||||||
|
// https://developomp.com/stats/* -> https://analytics.umami.is/*
|
||||||
|
"^/stats/.*": {
|
||||||
|
target: "https://analytics.umami.is/",
|
||||||
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.slice(6), // slice "/stats" off the string (which is 6 characters long)
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue