ring 2023-09-05

I’m not sure I am taking full advantage of the repl when developing my ring app. If I modify a function in my editor and eval the definition, I then have to (future-cancel) the server and start a new one. What should I be doing?

Specifically, using #'handler instead of handler when starting your server and wrapping your handler with middleware. (hard to be more specific without seeing your code)

Yes, using #' seems to be what I’m missing. Thanks @seancorfield

If you care about performance very much, another option is to eta expand the function:

(fn ([request] (handler request))
    ([request s f] (handler request s f)))

You can call it a compiler trick

But what I like doing in the repl is to not bring up a server, but have a function that returns my handler then call it and apply the handler to a request built with ring.mock

❤️ 1