Redis session store-connector to work with hono-sessions This repo is a fork of connect-redis-hono
$ pnpm add hono-sessions-redis
import { Hono } from "hono";
import { sessionMiddleware } from "hono-sessions";
import { RedisStoreAdapter } from "hono-sessions-redis";
// ...
// create your RedisClient and connect to your redis server
// ...
const store = new RedisStoreAdapter({
prefix: "AppPrefix:",
ttl: 3600, // seconds
client: RedisClient,
});
const app = new Hono();
app.use(sessionMiddleware({
store, // pass your store
// ...other session options
}));
app.get("/", (ctx) => {
return ctx.text("Session data stored on Redis");
});
export default {
port: 3000,
fetch: app.fetch,
};
As of right now this package is only compatible with ioredis.