Releases: sparckles/Robyn
v0.16.0 Add Response Headers and Improve performance
What's Changed
- Code cleanup by @sansyrox in #178
- Implement Response headers by @sansyrox in #179
- Add experimental io-uring by @sansyrox in #184
- Remove hashmap clones by @sansyrox in #187
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
What's Changed
- Update README.md by @Polokghosh53 in #168
- Use Clippy tool optimized code by @mrxiaozhuox in #171
- Make websocket id accessible by @sansyrox in #173
New Contributors
- @Polokghosh53 made their first contribution in #168
- @mrxiaozhuox made their first contribution in #171
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
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
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
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!
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
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
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
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
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
What's Changed
- Add project-wide flake8 settings by @sansyrox in #143
- URL queries by @patchgamestudio in #146
- Fix dev server by @sansyrox in #148
New Contributors
- @patchgamestudio made their first contribution in #146
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 🥳