---- 1000 HTTP Requests ----
Flask Server
--- 1.7611534595489502 seconds in total ---
--- 0.0017611534595489502 seconds per iteration ---
FastAPI Server
--- 1.5010621547698975 seconds in total ---
--- 0.0015010621547698975 seconds per iteration ---
Rocket Server
--- 1.741997241973877 seconds in total ---
--- 0.001741997241973877 seconds per iteration ---
Oxygen.jl Server
--- 1.1278553009033203 seconds in total ---
--- 0.0011278553009033204 seconds per iteration ---
Please consider adding some context to your post, what have you benchmarked? Are then benchmarks open source? What are the benchmarks representative of?
At the moment there’s no explicit JWT demo, but there are some relevant examples to help you get where you want to go.
Oxygen.jl includes BearerAuth middleware function which will automatically extract out the bearer auth token from the Authorization header.
It expects you to write your own validation token function to determine if the user is authorized and return their corresponding user info / auth details. From there you could use a library like JWTs.jl to parse and validate the actual token.
# Your function will need to perform actual token validation
function validate_token(token::String)
# return the user object
return Dict("name" => "joe")
end
# Only let requests with a valid token through
serve(middleware=[BearerAuth(validate_token)])
Then the data is then assigned to the req.context[:user] property of the incoming request.
# pull the name from the user context property
@get "/greet" function(req)
first_name = req.context[:user]["name"]
return "hello: $first_name"
end
I’ve had some good experiences with Oxygen.jl on the backend and React/Vite on the frontend, with either REST or Websockets. This has turned out to be a really productive environment for rapid development using agentic coding assistants.