Help with Genie

I am really new(like 30 minutes new) to web developement in julia,what is that I am messing up in this part??

ashwani@ashwani:~$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.2 (2020-09-23)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Genie,Genie.Router

(@v1.5) pkg> status Genie
Status `~/.julia/environments/v1.5/Project.toml`
  [c43c736e] Genie v1.7.4

julia> route("/") do
       "Hello - Welcome to Genie!"
       end
[GET] / => #1 | :get

julia> up()

 Web Server running at http://127.0.0.1:8000 
Genie.AppServer.ServersCollection(Task (failed) @0x00007fd08852fd00, nothing)

The link keeps loading and doesn’t work really,it shows Task failed too,so something is wrong

I have the exact same problem… I originally thought it was versioning but even downgrading doesn’t work… is it Julia or Genie because it’s the first thing on the Getting Started page…
Getting_Started

1 Like

Heya, as stated before I have run into the same problem… a temporary fix would be:
up(async = false) OR in my case I had to up(8001, async = false)

1 Like

With Julia 1.5.2 and Genie 1.8.0 loading the page does work for me, but takes a few seconds the first time. Doing a down() and then up() again and then reloading the page is quick after that.

Edit: full trace

julia> using Genie,Genie.Router
[ Info: Precompiling Genie [c43c736e-a2d1-11e8-161f-af95117fbd1e]

(@v1.5) pkg> 

(@v1.5) pkg> status Genie
Status `~/.julia/environments/v1.5/Project.toml`
  [c43c736e] Genie v1.8.0

julia> route("/") do
              "Hello - Welcome to Genie!"
              end
[GET] / => #1 | :get

julia> up()

 Web Server running at http://127.0.0.1:8000 
Genie.AppServer.ServersCollection(Task (runnable) @0x00007fcf7f1bc9d0, nothing)

julia> [ Info: / 200
┌ Error: /favicon.ico 404
â”” @ Genie.Router ~/.julia/packages/Genie/RldZn/src/Router.jl:163

julia> down()
┌ Warning: Interrupted: listen(HTTP.Servers.Server{Nothing,Sockets.TCPServer}(nothing, Sockets.TCPServer(RawFD(0xffffffff) closed), "127.0.0.1", "8000"))
â”” @ HTTP.Servers ~/.julia/packages/HTTP/IAI92/src/Servers.jl:273
Genie.AppServer.ServersCollection(Task (done) @0x00007fcf7f1bc9d0, nothing)

julia> up()

 Web Server running at http://127.0.0.1:8000 
Genie.AppServer.ServersCollection(Task (runnable) @0x00007fcf7f205d50, nothing)

julia> [ Info: / 200

From the getting started code:

julia> using Genie, Genie.Router

julia> route("/hello") do
          "Hello World"
       end

julia> up()

The docs says immediately afterwards:

That’s all! We have set up an app, a route, and started the web server. Open your favourite web browser and go to http://127.0.0.1:8000/hello to see the result.

You have to go to: http://127.0.0.1:8000/hello
Not: http://127.0.0.1:8000 (which I also did by mistake).

1 Like