ItalyPaleAle / svelte-spa-router

Router for SPAs using Svelte 3
MIT License
1.53k stars 105 forks source link

In vite, i can't use the proxy /dev #294

Closed cmdparkour closed 1 year ago

cmdparkour commented 1 year ago

when i use axios to get the interface: /dev/get/list, it render a page 404, so i think it can handle all the routers but i need to /dev to my real address, so what can i do when i use svelet spa router

cmdparkour commented 1 year ago

i need to change the proxy config to: proxy: { '/dev': { target: 'http://myaddress.com', changeOrigin: true, rewrite: (path) => path.replace(/^\/dev/, '') }, },