dhruvrajvanshi / Moonshine

Web framework for Crystal language [DEPRECATED in favour of kemal]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fixing Moonshine on FrameworkBenchmarks

Jesterovskiy opened this issue · comments

When fixing Crystal frameworks in FB found this issue:
sample code

require "moonshine"

include Moonshine
include Moonshine::Utils::Shortcuts

app = App.new
app.run(8080)

error

➜  moonshine git:(fix_crystal_lang) ✗ crystal test.cr
Error in ./test.cr:7: instantiating 'Moonshine::Core::App#run(Int32)'

app.run(8080)
    ^~~

in ./libs/moonshine/moonshine/core/app.cr:29: instantiating 'HTTP::Server#listen()'

      server.listen()
             ^~~~~~

in macro 'spawn' /usr/local/Cellar/crystal-lang/0.13.0/src/concurrent/concurrent.cr:37, line 8:

  1.   
  2.     ->(
  3.       
  4.         __arg0 : typeof(server.accept),
  5.       
  6.       ) {
  7.       spawn do
  8.         handle_client(
  9.           
 10.             __arg0,
 11.           
 12.         )
 13.       end
 14.     }.call(server.accept)
 15.   

        handle_client(
        ^~~~~~~~~~~~~

instantiating 'handle_client(TCPSocket+)'
in /usr/local/Cellar/crystal-lang/0.13.0/src/http/server/server.cr:157: instantiating 'Moonshine::Core::App#call(HTTP::Server::Context)'

        @handler.call(context)
                 ^~~~

in ./libs/moonshine/moonshine/core/app.cr:109: no overload matches 'Moonshine::Http::Request#initialize' with type HTTP::Server::Context
Overloads are:
 - Moonshine::Http::Request#initialize(request : HTTP::Request)

      request = Request.new(req)

in shards branch is master