Skip to content

JeanPinzon/py-easy-rest-redis-cache

Repository files navigation

Lint Build and Test Upload Package PyPI version

py-easy-rest-redis-cache

Cache lib to use with py-easy-rest

Getting Started

How to install

pip install py-easy-rest py-easy-rest-redis-cache

Integrating with your py-easy-rest app

#main.py
from py_easy_rest import PYRSanicAppBuilder
from py_easy_rest.service import PYRService
from py_easy_rest_redis_cache import PYRRedisCache


config = {
    "name": "Project Name",
    "schemas": [{
        "name": "Mock",
        "slug": "mock",
        "properties": {
            "name": {"type": "string"},
            "age": {"type": "integer"},
        },
        "required": ["name"],
    }]
}

cache = PYRRedisCache("redis://localhost")

service = PYRService(api_config_mock, cache=cache)
sanic_app = PYRSanicAppBuilder.build(api_config_mock, service)

sanic_app.run(
    host='0.0.0.0',
    port=8000,
    debug=True,
)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published