Skip to content

Instantly share code, notes, and snippets.

@qszhu qszhu/ Secret
Created May 24, 2019

What would you like to do?
require "onyx/http"
Onyx::HTTP.get "/" do |env|
env.response << "Hello, Onyx!"
end "/foo" do |env|
env.response << "bar"
Onyx::HTTP.listen do |handlers|
router_middleware = handlers[-2].as(Onyx::HTTP::Middleware::Router)
pp router_middleware.@hash.keys # ["/get", "/post/foo"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.