Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite not working with external url with the port #210

Open
introverso opened this issue Sep 5, 2024 · 0 comments
Open

Rewrite not working with external url with the port #210

introverso opened this issue Sep 5, 2024 · 0 comments

Comments

@introverso
Copy link

Run with configured redirects with the specified port:

"redirects": [
    {
      "source": "/api/endpoint",
      "destination": "http://redirect-url:20000/endpoint"
    }
]

Fails with:

INFO  Gracefully shutting down. Please wait...
/Users/crbx/Library/pnpm/store/v3/tmp/dlx-35334/node_modules/.pnpm/[email protected]/node_modules/path-to-regexp/index.js:194
     throw new TypeError('Expected "' + token.name + '" to be ' + (token.repeat ? 'an array' : 'a string'))
           ^

TypeError: Expected "20000" to be a string
   at /Users/user/Library/pnpm/store/v3/tmp/dlx-35334/node_modules/.pnpm/[email protected]/node_modules/path-to-regexp/index.js:194:13
   at toTarget (/Users/user/Library/pnpm/store/v3/tmp/dlx-35334/node_modules/.pnpm/[email protected]/node_modules/serve-handler/src/index.js:88:9)
   at shouldRedirect (/Users/user/Library/pnpm/store/v3/tmp/dlx-35334/node_modules/.pnpm/[email protected]/node_modules/serve-handler/src/index.js:174:18)
   at module.exports (/Users/user/Library/pnpm/store/v3/tmp/dlx-35334/node_modules/.pnpm/[email protected]/node_modules/serve-handler/src/index.js:583:19)
   at run (file:///Users/user/Library/pnpm/store/v3/tmp/dlx-35334/node_modules/.pnpm/[email protected]/node_modules/serve/build/main.js:181:13)
   at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant