Unable to get Genie.jl webpage on another local computer

80 Views Asked by At

I am trying to create a webpage on headless raspberry pi using Julia's Genie framework. I tried running these simple commands link. I ran the commands by connecting to raspberry pi via SSH. Being a headless raspberry pi i.e. no keyboard, mouse and display, I tried running "http://127.0.0.1:8000" on a separate computer on the local network. But it does not work.

May I know how to access the webpage running on raspberry pi on a different computer on local network.

Thank you

These are the following steps I performed.

input:

julia> using Genie, Genie.Router

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

output:

[GET] /hello => #3 | :get_hello

input:

up()

output:

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

I tried running "http://127.0.0.1:8000/hello" on a separate computer on the local network. But it does not work. Instead I get the following result, I get "unable to connect" Output.

1

There are 1 best solutions below

1
On BEST ANSWER

See https://genieframework.com/docs/genie/v5.11/API/genie.html#Genie.up

You should specify host as up(8000,"0.0.0.0") to enable access from local network. And access the site with http://IP_ADDRESS_OF_raspberry:8000/hello on another computer.