> There is not ONE place online, where you can learn ALL what is possible with 
> Nim.

But <https://nim-lang.org/documentation.html> comes close.

There is also <https://nim-lang.org/docs/theindex.html>, I do search for 
"server" and it points me to <https://nim-lang.org/docs/asynchttpserver.html> 
which contains:
    
    
    import std/asynchttpserver
    # This example will create an HTTP server on an automatically chosen port.
    # It will respond to all requests with a `200 OK` response code and "Hello 
World"
    # as the response body.
    import std/asyncdispatch
    proc main {.async.} =
      var server = newAsyncHttpServer()
      proc cb(req: Request) {.async.} =
        echo (req.reqMethod, req.url, req.headers)
        let headers = {"Content-type": "text/plain; charset=utf-8"}
        await req.respond(Http200, "Hello World", headers.newHttpHeaders())
      
      server.listen(Port(0)) # or Port(8080) to hardcode the standard HTTP port.
      let port = server.getPort
      echo "test this with: curl localhost:" & $port.uint16 & "/"
      while true:
        if server.shouldAcceptRequest():
          await server.acceptRequest(cb)
        else:
          # too many concurrent connections, `maxFDs` exceeded
          # wait 500ms for FDs to be closed
          await sleepAsync(500)
    
    waitFor main()
    
    
    Run

And these examples are guaranteed to compile&run because the infrastructure 
ensures that. And this is all available for free, not to mention there are 
internet search engines and AI bots that can write Nim code for you.

But no, we need no less than a new documentation task force that writes yet 
another book. For whom? For the people that are already overwhelmed?

This is ridiculous.

Reply via email to