Open
Description
How can I use route configuration to setup path wildcard write in azure static web apps?
For example, I have a website domain: https://myweb.azurestaticapps.net, and file structure like below:
- /js
- /default.js
- helper.js
- /assets
- /imgs
- /p1.jpg
- /p2.jpg
- /imgs
I'd like to use wildcard pattern in rewrite
property just as what reverse proxy does.
ex:
- /myjs/default.js ----> /js/default.js
- /imgs/p1.jpg ----> /assets/imgs/p1.jpg
I've set route rewrite rules in staticwebapp.config.json but it was not work:
{
"routes": [
{
"route": "/myjs/*",
"rewrite": "/js/*"
},
{
"route": "imgs/*",
"rewrite": "/assets/imgs/*"
}
]
}
Is there any way to do this in static web apps? please help, thanks!
BTW, I think It would really useful especially when migrating our legacy website into azure static web apps!