Skip to content

Releases: sparckles/Robyn

v0.16.0 Add Response Headers and Improve performance

29 Apr 12:10
Compare
Choose a tag to compare

What's Changed

New Contributors

  • @sombralibre made their first contribution in #189

Full Changelog: v0.15.1...v0.16.0

You can now have the response headers:

@app.get("/redirect")
async def redirect(request):
    return {"status_code": "307", "body": "", "type": "text", "headers": jsonify({"Location": "redirect_route"})}

Websocket ids now accessible in websocket functions

24 Mar 23:59
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.15.0...v0.15.1

Now, you can access web socket uuids from the functional calls

@websocket.on("message")
async def connect(websocket_id):
    print(websocket_id)
    global i
    i += 1
    if i == 0:
        return "Whaaat??"
    elif i == 1:
        return "Whooo??"
    elif i == 2:
        i = -1
        return "*chika* *chika* Slim Shady."

Mutable request objects

17 Mar 00:28
Compare
Choose a tag to compare

Now you can mutate the request object through the request callback.

Example below

@app.get("/redirect")
async def redirect(request):
    return {"status_code": "307", "body": "", "type": "text"}


@app.get("/redirect_route")
async def redirect_route(request):
    return "This is the redirected route"


@app.before_request("/redirect")
async def redirect_before_request(request):
    request["headers"]["Location"] = "redirect_route"
    return ""


@app.after_request("/redirect")
async def redirect_after_request(request):
    request["headers"]["Location"] = "redirect_route"
    return ""

v0.14.0 - Added custom response objects

03 Mar 00:42
Compare
Choose a tag to compare

Robyn supports custom response objects now! 🥳

What's Changed

Full Changelog: v0.13.1...v0.14.0

Example

@app.get("/")
async def hello(request):
    global callCount
    callCount += 1
    message = "Called " + str(callCount) + " times"
    print(message, request)
    return {"status_code": "200", "body": "hello", "type": "text"}


@app.get('/404')
def return_404():
    return {"status_code": "404", "body": "hello", "type": "text"}

v0.13.1 | Robyn installation fixed via conda-forge

20 Feb 01:33
Compare
Choose a tag to compare

No major functional changes. Only support changes.

You can use conda for installations:

conda install -c conda-forge robyn

What's Changed

Full Changelog: v0.13.0...v0.13.1

v0.13.0 - Middlewares!

15 Feb 23:39
Compare
Choose a tag to compare

Robyn now supports middlewares!!

Sample Usage

You can use both sync and async functions for middlewares!

@app.before_request("/")
async def hello_before_request(request):
    print(request)


@app.after_request("/")
def hello_after_request(request):
    print(request)

What's Changed

Full Changelog: v0.12.1...v0.13.0

v0.12.1 - Default url bug fix

13 Feb 17:01
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.12.0...v0.12.1

There was an error in the previous release that the app.start() function was defaulting to 128.0.0.1 instead of 127.0.0.1. This PR fixes it.

This release fixes it.

v0.12.0 - Events added

20 Jan 22:38
Compare
Choose a tag to compare

Robyn now supports startup and shutdown events and is now backed with a more stable build backend.

Sample Usage

You can either use the decorator syntax or the functional call syntax to organise your code.

async def startup_handler():
    logger.log(logging.INFO, "Starting up")
app.startup_handler(startup_handler)

@app.shutdown_handler
def shutdown_handler():
    logger.log(logging.INFO, "Shutting down")

What's Changed

Special Thanks

  • @klaa97 for making robyn's PR at TechEmpoweredBenchmark's repo!

Full Changelog: v0.11.1...v0.12.0

v0.11.1 - Make Robyn work with docker containers

11 Jan 23:09
Compare
Choose a tag to compare

This is a minor release. An input statement was being used instead of a print statement. This will help with docker containers and also Tech-Empowered benchmarking.

What's Changed

  • Use print instead of input after starting server by @klaa97 in #149

New Contributors

Full Changelog: v0.11.0...v0.11.1

Special thanks to @klaa97 for identifying the bug and fixing it! 🥳

v0.11.0 - Add support for query params across EVERY HTTP method and dev server fix

07 Jan 09:56
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.10.0...v0.11.0

Summary

You can make a request to http://localhost:5000/query?a=b and can access the params in the following way:

@app.get("/query")
async def query_get(request):
    query_data = request["queries"]
    return jsonify(query_data)

The hot reloading server is now fixed and works on Linux and OSX(i.e. on all important operating systems). Windows support for dev server is still WIP.

Special thanks to @patchgamestudio for their contribution with the query params 🥳