NET8 ReactApp 範本
NET8 + React.v18 with TypeScript 範本, React and ASP.NET Core, useFormHook,
Last updated
NET8 + React.v18 with TypeScript 範本, React and ASP.NET Core, useFormHook,
Last updated
// [...略...]
// https://vitejs.dev/config/
export default defineConfig({
plugins: [plugin()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
proxy: {
//'^/weatherforecast': { //------ 預設只開通 weatherforecast API。
'^/api/(\\w+)': { //------ 改成 api 開頭的API都能通過proxy。
target: 'https://localhost:7144/',
secure: false
}
},
port: 5173,
https: {
key: fs.readFileSync(keyFilePath),
cert: fs.readFileSync(certFilePath),
}
}
})