luminus-framework/luminus

Figwheel Server: Resource not found

Closed this issue · 4 comments

I'm using luminus with cljs profile and running via figwheel. I've been having no problem but since yesterday figwheel server isn't working. I have no idea why. Does anyone know why?
When I enter the address which is 'localhost:3449', the page comes up stating
"Figwheel Server: Resource not found
Keep on figwheelin' "

I have made my project like below:
lein new luminus lumi +postgres +reagent
by default, the project didn't create index.html file which usually located in 'resources/public' folder. I guess this file is related to this issue.

But the thing is,
it worked really well until yesterday without index.html file.
But since yesterday(maybe few days more) it stopped working.

I want to fix this problem and also I want to know the reason. Can anybody help me?

Just in case, I'm putting warning message from terminal reporting when I typed lein figwheel.
WARNING: unable to load "cider/wrap-cljs-repl" middleware
I'm not sure whether it's related to my issue

Hi,

The template is setup to use Figwheel to compile ClojureScript, but the page is served by the server that's run with lein run on port 3000 (by default). The reason you don't need index.html is because the HTML page will be served by the / route in the <project name>/routes/home.clj namespace.

So the way you'd typically run the app would be to start the server with lein run in one terminal, and run lein figwheel to compile ClojureScript in another.

You can setup Figwheel to use a custom handler as well by adding :ring-handler <project name>.server/app in the :figwheel config in project.clj, but the caveat there is that Figwheel runs its own embedded Jetty server that may have different behavior from the HTTP server that's run by the application. Therefore, it's better to run the server explicitly.

Thank you so much for reply!
But I've been running server with lein run already before running lein figwheel.
and as I said, it worked really well until few days ago.

Anyway I appreciate that you explain me the index.html.

oh I just found the answer!

so you said port 3000, and I was connecting via port 3449..
Actually I saw port 3449 on the figwheel terminal message and furthermore I was following other tutorial(other than luminus) which use port 3449. That's why I kept connecting via 3449 even in luminus.

Can you explain by any chance the difference between port 3000 and 3449?

Figwheel has its own HTTP server for standalone development, and there doesn't appear to be a flag to turn it off. So, it just ends up running on the side doing nothing. The server on port 3000 is the one started by the app in the <project name>.core/-main entry point.

wow thank you so much! Now I got it completely!