Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anchan828/nest-session
This repository is based on nestjs-session
https://github.com/anchan828/nest-session
nestjs session
Last synced: 3 months ago
JSON representation
This repository is based on nestjs-session
- Host: GitHub
- URL: https://github.com/anchan828/nest-session
- Owner: anchan828
- License: mit
- Archived: true
- Created: 2019-10-16T08:20:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-09T04:02:55.000Z (7 months ago)
- Last Synced: 2024-09-19T07:43:24.882Z (3 months ago)
- Topics: nestjs, session
- Language: TypeScript
- Homepage:
- Size: 29.4 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @anchan828/nest-session
Sample: https://codesandbox.io/s/anchan828-nest-redis-session-express-sample-cne6w0?file=/src/app.module.ts
```ts
import { RedisSessionModule } from "@anchan828/nest-redis-session-express";
// or
import { RedisSessionModule } from "@anchan828/nest-redis-session-fastify";// redis@v4
import { createClient } from "redis";
const redisClient = createClient({ legacyMode: true });
redisClient.connect().catch(console.error);// redis@v3
import { createClient } from "redis";
const redisClient = createClient();// ioredis
import IORedis from "ioredis";
const redisClient = new IORedis();// redis-mock
import { createClient } from "redis-mock";
const redisClient = createClient();// ioredis-mock
const IORedisMock = require("ioredis-mock");
const redisClient = new IORedisMock();@Module({
imports: [
RedisSessionModule.register({
redisClient,
session: {
secret: "secret",
saveUninitialized: false,
resave: false,
},
}),
],
})
export class AppModule {}
```