envymike
envymike

Reputation: 165

Clojure Pedestal Windows WSL2 browsers not rendering

I finished a pedestal clojure app and used the repl to start the server which it starts. I can only curl and can't access the project on any browser with localhost:8080. I did the frontend with Clojurescript/Shadowcljs which works fine in the browser, so it can't be an overall issue via localhost (a host issue).

To further check issues I followed step by step this tutorial app (just to be 100% sure), and it too only loads via curl and not in the browser as the tutorial states it should be able to load in the browser (not changing any code).

I am using Windows wsl2 with all my apps of varies languages but this one with clojure and pedestal won't load in the browser no matter if I even try the dockerfile included.

Thank You for any help you can give me on this situation because I am lost.

Upvotes: 1

Views: 155

Answers (1)

andy
andy

Reputation: 36

So I was curios the way I got it to work was by adding> Thats using a browser on windows side to wsl linux using http://localhost:8080/

::http/host "0.0.0.0"

to

    (def service {:env                 :prod
    ::http/host "0.0.0.0"
    ::http/routes        routes
    ::http/resource-path "/public"
    ::http/type          :jetty
    ::http/port          8080})

I found the info at

https://www.bleepingcomputer.com/news/security/wsl2-now-supports-localhost-connections-from-windows-10-apps/

https://github.com/pedestal/pedestal/issues/604#issuecomment-529469681

Upvotes: 1

Related Questions