crystal-lang / crystal-website

crystal-lang.org website
60 stars 75 forks source link

HTTP Server example uses server.bind instead of server.bind_tcp #760

Closed wout closed 5 months ago

wout commented 5 months ago

In the HTTP Server example on the home page, this line:

address = server.bind(8080)

Results in:

In server.cr:9:23

 9 | address = server.bind(8080)
                           ^
Error: expected argument #1 to 'HTTP::Server#bind' to be Socket::Server, String or URI, not Int32

Overloads are:
 - HTTP::Server#bind(uri : String)
 - HTTP::Server#bind(uri : URI)
 - HTTP::Server#bind(socket : Socket::Server)

It should be:

address = server.bind_tcp(8080)