question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support URL/URI option in options

See original GitHub issue

Per the documentation, we can create a new Redis instance via:

// Connect to 127.0.0.1:6380, db 4, using password "authpassword":
new Redis('redis://:authpassword@127.0.0.1:6380/4')

At the same time there does not appear to be an equivalent solution of passing a URL if we provide options.

Am I missing this option? If not, could this be added in a future version?

Rereading the docs, I see we can do:

new Redis(url, options)

though it would still be good to allow the url to be specified in the options, so we can directly copy a configuration into the constructor.

Using ioredis 4.9.3.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ajmascommented, May 15, 2019

It would be for consistency at the very least, since currently both port and host are both available in the argument and the options. It would also allow to have a configuration of the form (which may be copied straight from a config file):

var config = {
  url: 'redis://...',
  keyPrefix: 'prefix-',
  lazyConnect: false
}

new Redis(config)
0reactions
luincommented, May 16, 2019

Yes, that may be. Currently the options resolver follows the rule same as Object.assign(), so the latter one take precedence.

Read more comments on GitHub >

github_iconTop Results From Across the Web

what are URL options? - Stack Overflow
There is currently only one option you can include: universalLinksOnly . Universal links are URLs that apps signed up to handle, ...
Read more >
OPTIONS - HTTP - MDN Web Docs
The HTTP OPTIONS method requests permitted communication options for a given URL or server. A client can specify a URL with this method, ......
Read more >
application(_:open:options:) | Apple Developer Documentation
application(_:open:options:) Asks the delegate to open a resource specified by a URL, and provides a dictionary of launch options.
Read more >
About targets for Dynamic Search Ads - Google Ads Help
You can target pages with URLs that contain a certain piece of text, called a token. In a URL, a token is surrounded...
Read more >
The 7 best URL shorteners of 2022 - Zapier
To help you find the right URL shorteners for most people, I tested more than 35 different options. These are the best—and what...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found