Giter Club home page Giter Club logo

Comments (3)

ralyodio avatar ralyodio commented on August 18, 2024 1

Nevermind. I had wreong env variable name

from redis.

uki00a avatar uki00a commented on August 18, 2024

@oplik0 Thanks for your suggestion! I think having support for the redis url is good 😃

From my understanding, they require a bit more complicated logic than simple connect, as they actually should be equivalent to connecting and then issuing AUTH and/or SELECT commands if password and/or database number were specified.

The connect() function automatically executes AUTH and/or SELECT commands if password and/or db options were specified in RedisConnectOptions. So I think it would be good to add a simple utility to parse the redis url as follows:

parseURL(url: string): RedisConnectOptions

import { connect, parseURL } from "https://deno.land/x/redis/mod.ts";

const options = parseURL("redis://foo:bar@localhost:6379/1");
const redis = await connect(options);
console.log(await redis.get("key"));

from redis.

ralyodio avatar ralyodio commented on August 18, 2024

This is broken

$ ./bin/start.sh
PORT: 8061
Download ⠼ https://deno.land/x/[email protected]/buf_reader.ts                                                                                                                  Warning Implicitly using latest version (v0.27.4) for https://deno.land/x/redis/mod.ts
error: Uncaught TypeError: Invalid URL
  } = new URL(url);
      ^
    at getSerialization (deno:ext/url/00_url.js:76:13)
    at opUrlParse (deno:ext/url/00_url.js:67:12)
    at new URL (deno:ext/url/00_url.js:358:29)
    at parseURL (https://deno.land/x/[email protected]/redis.ts:2408:7)
    at file:///home/ettinger/www/grazily.com/grazily-api/index.ts:25:19


import { Application, config, oakCors, Mongo, redis, redisParseURL } from "./src/deps.ts";


const redisOpts = redisParseURL(env.redis);
const cache = await redis(redisOpts);

from redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.