Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm using the react asp.net core preview project with Visual Studio 2022. I have created a controller called WordController. My vite.config.js is as below. When I run the application, however, the request still keeps resolving to https://localhost:5173/weatherforecast.

How do I get the request to my controller?

What I have tried:

<pre>export default defineConfig({
    plugins: [plugin()],
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        }
    },
    server: {
        proxy: {
          
            '^/word': {
                target: 'https://localhost:7106/',
                secure: false
            }
         

        },
        port: 5173,
        https: {
            key: fs.readFileSync(keyFilePath),
            cert: fs.readFileSync(certFilePath),
        }
    }
})
Posted
Comments
Graeme_Grant 11-Oct-23 5:37am    
What is your routing setup server side in Asp.Net?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900