1

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 Answers1

1

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.

xgdgsc
  • 1,367
  • 13
  • 38
  • or for production environments you could put Nginx in front of Genie (in that case Nginx will need to listen on "0.0.0.0" rather than Genie). See https://genieframework.github.io/Genie.jl/dev/tutorials/92--Deploying_Genie_Server_Apps_with_Nginx.html – Przemyslaw Szufel Jul 12 '23 at 06:46