Upstash Redis Setup

The only safe and reasonable answer is in the example code for setting up a local tunnel, which is very strange. This should be the primary documentation.

const redis = require("redis");

// Local Redis URL for development
const LOCAL_REDIS_URL = 'redis://localhost:10000'; // Replace with your actual local address
const REDIS_URL = process.env.NODE_ENV === 'development' ? LOCAL_REDIS_URL : process.env.REDIS_URL;

const client = redis.createClient({
    url: REDIS_URL
});

client.on("error", function(error) {
  console.error(error);
});

// Rest of your Redis-related code

Ref: Fly.io - Upstash Documentation