You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"rules": [
{
"description": "Route all API requests to localhost:3000",
"from": {
"host": ".*",
"path": "^/api(/.*)?$"
},
"to": {
"host": "localhost:3000",
"path": "$0"
},
"public": true
},
{
"description": "Route all other requests to localhost:2222",
"from": {
"host": ".*",
"path": ".*"
},
"to": {
"host": "localhost:2222",
"path": "$0"
},
"public": true
}
]
}
Explanation:
The first rule is designed to handle all requests with paths starting with "/api/". It uses regular expressions to match paths that start with "/api/" followed by optional additional segments. For these requests, the traffic is directed to "localhost:3000" while preserving the original path.
The second rule is a catch-all for all other requests that do not match the first rule. It will handle requests with any path and direct them to "localhost:2222" while preserving the original path.
Please give an example file "routes.json"
The text was updated successfully, but these errors were encountered: