Closed vladfaust closed 6 years ago
add it to official git it will be great,i also spend time on it,making wheels is not good
There's already an option for this Kemal.config.server =
, isn't that enough?
@sdogruyol yep, config has server
property, but it's useless due to this line: https://github.com/kemalcr/kemal/blob/8cf3f67594394665db2b17f9675ca38fbf427ef5/src/kemal.cr#L35
Basically, you can get server only after Kemal.run
, and it blocks the thread, am I right?
I propose changing the line above to config.server ||= HTTP::Server.new(config.host_binding, config.port, config.handlers)
, so a developer could setup the server before Kemal is run.
Currently
#run
forces the server to start listening, whilst the server can be used as a mountable server with HTTP::Multiserver.Please add a separate method
#server
to Kemal:so a user can mount Kemal apps like this:
This is a missing feature of Crystal which holds lots of potential developers from switching to it.