kemal v0.24.0 Release Notes
Release Date: 2018-08-14 // over 5 years ago-
๐ Crystal 0.26.0 support
[breaking change] Removed
env.params.files
. You can use Crystal's built-inHTTP::FormData.parse
insteadpost "/upload" do |env| HTTP::FormData.parse(env.request) do |upload| filename = file.filename if !filename.is\_a?(String) "No filename included in upload"else file\_path = ::File.join [Kemal.config.public\_folder, "uploads/", filename] File.open(file\_path, "w") do |f| IO.copy(file.tmpfile, f) end"Upload OK"endend
[breaking change] From now on to access dynamic url params in a WebSocket route you have to use:
ws "/:id" do |socket, context| id = context.ws_route_lookup.params["id"]end
[breaking change] Removed
_method
magic param.โ Added new exception page #466. Thanks @mamantoha ๐
๐ Support custom port binding. Thanks @straight-shoota ๐
Kemal.run do |config| server = config.server.not\_nil! server.bind\_tcp "127.0.0.1", 3000, reuse\_port: true server.bind\_tcp "0.0.0.0", 3001, reuse\_port: trueend