Rolo

Latest version: v0.5.1

Safety actively analyzes 641872 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.5.0

This release adds a few quality of life improvement for the Router and a way to serve static files. It also includes a bump in test coverage.

Summary

Serve static files

If you have a module with resources (say, `my_app.static`), you can serve them directly through:

python
from my_app import static

route("/static/<path:path>")
def handler(request, path):
return Response.for_resource(static, path)


The mimetype will be set automatically from the resource's file name.

Return lists from handlers

Using a handler dispatcher, you can now return not only dictionaries but also lists to be converted into json responses:

python
route("/list")
def handler(request):
return [{"id": 1}, {"id": 2}, {"id": 3}]


Will generate an appropriate json response.

Serve a Router as wsgi app.

You can now serve a `Router` instance as wsgi app by calling `Router.wsgi()`.

python
from werkzeug.serving import run_simple

from rolo import Router
from rolo.dispatcher import handler_dispatcher

router = Router(dispatcher=handler_dispatcher())
run_simple("localhost", 5000, router.wsgi())


What's Changed
* Indicate type support by bblommers in https://github.com/localstack/rolo/pull/10
* allow lists as return types for handler dispatchers by thrau in https://github.com/localstack/rolo/pull/11
* add method to create response from a static resource by thrau in https://github.com/localstack/rolo/pull/12

New Contributors
* bblommers made their first contribution in https://github.com/localstack/rolo/pull/10

**Full Changelog**: https://github.com/localstack/rolo/compare/v0.4.0...v0.5.0

0.3.0

Quick release to fix a concurrency issue in `Router`. Also, this release switches completely to pyproject.toml, thanks to silv-io!

What's Changed
* Switch to pyproject.toml by silv-io in https://github.com/localstack/rolo/pull/5
* make Router.add thread safe by thrau in https://github.com/localstack/rolo/pull/6

New Contributors
* silv-io made their first contribution in https://github.com/localstack/rolo/pull/5

**Full Changelog**: https://github.com/localstack/rolo/compare/v0.2.0...v0.3.0

0.2.0

Gateway & Handler chain migration

With 0.2.0, we migrated the `Gateway` and `HandlerChain` concepts from localstack into rolo. Part of that is a generalization and removal of AWS concepts. The `RequestContext` is now a flexible data container where arbitrary data can be stored through setting attributes `context.service = ...`.

This release also adds the necessary constructs to serve a `Gateway` as a WSGI or ASGI application.

What's Changed
* import gateway and handler chain code from localstack/localstack by thrau in https://github.com/localstack/rolo/pull/3
* add ruff config and fix linter errors by thrau in https://github.com/localstack/rolo/pull/4

**Full Changelog**: https://github.com/localstack/rolo/compare/v0.1.0...v0.2.0

0.1.0

Hello World!

We're releasing our HTTP framework used in localstack as a standalone project, _Rolo HTTP_. This is the first iteration that includes the core utilties we built around Werkzeug and Hypercorn.

**Full Changelog**: https://github.com/localstack/rolo/commits/v0.1.0

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.