umijs / umi-blog-example

An example of blog website built with Umi.js and new API route feature in Umi 4.
https://umijs.org/docs/tutorials/blog
37 stars 33 forks source link

Error: Unable to find environment variable: `UPSTASH_REDIS_REST_URL` #6

Closed ihamlet closed 2 years ago

ihamlet commented 2 years ago

Error: Unable to find environment variable: UPSTASH_REDIS_REST_URL

const redis = Redis.fromEnv()

The above code seems to need to configure an environment variable, but I don't know what to use.

yuaanlin commented 2 years ago

The current version of example code is using Redis (hosted by Upstash) as data caching layer to speed up API route fetching the post data from database.

UPSTASH_REDIS_REST_URL is the environment variable for the Redis REST API endpoint. You can follow the instructions on Upstash Docs.