Skip to content

Atakan75/elysia-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@Atakan75/elysia-redis

Redis plugin for Elysia.js

Installation

bun add @atakan75/elysia-redis

Usage

import { Elysia, t } from 'elysia';
import { redis } from '@Atakan75/elysia-redis';

const app = new Elysia()
    .use(redis())
    .get('/', async ({ redis }) => {
        await redis.set('elysia', 'redis', 60);
        const data = await redis.get('elysia');
        if (!data) {
            throw new Error('No data found');
        }
        return data;
    });

console.log(`Listening on http://${app.server!.hostname}:${app.server!.port}`)

Checkout the tests folders on github.

Need To Know

First of all, if you define REDIS_URL in the env file, it will take the value you enter. If you do not define anything, it will connect to the redis server installed in your local.

License

MIT

About

Redis plugin for Elysia 🦊

Resources

License

Stars

Watchers

Forks

Packages

No packages published