3

In Genie, I have the following code in routes.jl:

using Genie.Router

route("/") do
  serve_static_file("welcome.html")
end

I ran the server by typing up(). However, when I visit the index page, I get a 404 message:

julia> up()
┌ Info: 
└ Web Server starting at http://127.0.0.1:8000 
Genie.AppServer.ServersCollection(Task (runnable) @0x00000001765dbec0, nothing)

julia> ┌ Error: GET / 404
└ @ Genie.Router ~/.julia/packages/Genie/UxbVJ/src/Router.jl:163

I tried stopping the server and re-starting it but the issue persists. This happened to me at least 3-4 times now. I got it working in the past but it was not clear what actually worked.

logankilpatrick
  • 13,148
  • 7
  • 44
  • 125
  • Can you please explain how you start the app - what's the exact workflow that gives you this error? Once you create an app/project you must make sure that you load the app, following these steps: https://genieframework.com/docs/tutorials/Loading-Genie-Apps.html – essenciary Jan 31 '22 at 18:58
  • All I am doing is running `up()` as mentioned above. – logankilpatrick Jan 31 '22 at 21:53
  • Did you just create the new app or was the app created previously and you're now restarting the Julia session? Are you in the folder where the app was created? Have you loaded the app per the above link? Basically, how can I replicate the error on my side? – essenciary Feb 01 '22 at 12:59

1 Answers1

0

I am not sure whether this helps anyone, but I had a similar error. I later noticed that I hadn't installed a package which was necessary for my app (didn't have it in my project.toml file) when I had ran "loadapp()", and there was errors in precompilation of some files.

Not noticing those errors at first, I ran up() nonetheless, and was surprised that routing didn't work.

Once I installed that package, and restarted the Julia session, routing worked

jochen
  • 1
  • 1