-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Web UI #12
Comments
I'd be happy to help you about any Kemal related question 👍 |
The top-level DSL seems really cool at first glance but IMO it takes away a lot of capabilities. I'm really missing a more idiomatic OOP-based webapp style. Sinatra now provides something like this: class Sidekiq::Web < Kemal::Base
public_folder "..."
get "/" do |env|
end
end
# Allow multiple webapps to be mounted
Kemal.serve("localhost", 8080, {
"/sidekiq" => Sidekiq::Web
"/something-else" => Another::Web
}) With that style, you could also implement testing helpers, a la Rack::Test:
|
Yeah, i'm pretty aware of that and would like to implement the |
Done! I was able to implement GET and POST helper methods to make the Ruby port easier. Allows me to spec like this: post "/scheduled/#{job_params(*params)}", {"add_to_queue" => "true"}
assert_equal 302, last_response.status_code
assert_equal "/scheduled", last_response.headers["Location"]
get "/queues/default"
assert_equal 200, last_response.status_code
assert_match(/#{params.first["args"][2].to_s}/, last_response.body) |
Did this get implemented in a mountable way for Kemal? I've been writing Rails-like controllers with Kemal in danielpclark/crystal-rails-template require "../app/controllers/*"
module Railslike
module Routes
include Controllers
get "/", &IndexController.to_proc
error 404, &Error404Controller.to_proc
end
end Where each method I define ( def self.to_proc
->(env : HTTP::Server::Context){
controller = new(env) # Evaluated in other controller context of type BaseController
controller.render(controller) # Pass context into layout renderer
}
end This works very well for me. But I digress, has this been implemented to run Sidekiq mounted in an existing server instance of Kemal? |
@danielpclark unfortunately, this is not implemented. Kemal only allows single app per single process (for now) |
Sidekiq's Web UI is based on Sinatra. Investigate building a native Crystal version using Kemal and ecr views instead.
Requires #11.
The text was updated successfully, but these errors were encountered: