Summary
Create a sample that rewrites HTTP requests to HTTPS during development.
Plugins to use
RewritePlugin - rewrites request URLs using regex
What to build
- Configure URL rewriting from HTTP to HTTPS
- Other useful rewrite patterns:
- Change API versions (v1 to v2)
- Redirect staging to production URLs
- Add/modify query parameters
Configuration example
{
"rewritePlugin": {
"rewritesFile": "rewrites.json"
}
}
rewrites.json:
{
"rewrites": [
{
"in": { "url": "^http://(.*)" },
"out": { "url": "https://$1" }
}
]
}
Why this is compelling
Match production security locally. Test against HTTPS without certificate hassles.
Reference docs
- RewritePlugin technical reference