Fork me on GitHub
#figwheel-main
<
2023-03-22
>
Alejandro13:03:32

UPDATE: never mind, found this link: https://figwheel.org/docs/your_own_server.html What if I'd like to actually handle the request to / ? Is it possble? Here's a section in the docs I'm talking about: https://figwheel.org/docs/ring-handler.html#the-last-handler > The function you specify in :ring-handler will be the last handler in the Figwheel middleware chain. This means it will only be called if the request isn’t handled by other middleware. > This can cause confusion if you have an index.html file present and you are trying to respond to a request for the root path / in your handler. In this case the Figwheel middleware will handle the root path returning the index.html file before the request has a chance to make it to your handler.

Alejandro16:03:50

Another question: how to send data from server to browser? Figwheel.sidecar server had a send-message function. UPDATE: is it not implemented yet? https://github.com/bhauman/figwheel-main/issues/54 Any hints on how to implement this? I would try and send a pr THE FINAL UPDATE: I figured it out, you run the following on the server:

(binding [cljs.repl/*repl-env* (figwheel.main.api/repl-env "dev")]
  (figwheel.core/client-eval "hello_world.core.greet(\"Alejandro\")"))