In R we may use Shiny and in python we could use Streamlit. It seems that in Julia we could use the Genie
framework to create web applications. When I am trying to run a simple app, the app doesn't work with up()
. I have the following script called app.jl
:
using Genie
route("/hello") do
"Welcome to Genie!"
end
First we load the app:
Genie.loadapp()
Output:
██████╗ ███████╗███╗ ██╗██╗███████╗ ███████╗
██╔════╝ ██╔════╝████╗ ██║██║██╔════╝ ██╔════╝
██║ ███╗█████╗ ██╔██╗ ██║██║█████╗ ███████╗
██║ ██║██╔══╝ ██║╚██╗██║██║██╔══╝ ╚════██║
╚██████╔╝███████╗██║ ╚████║██║███████╗ ███████║
╚═════╝ ╚══════╝╚═╝ ╚═══╝╚═╝╚══════╝ ╚══════╝
| Website https://genieframework.com
| GitHub https://github.com/genieframework
| Docs https://genieframework.com/docs
| Discord https://discord.com/invite/9zyZbD6J7H
| Twitter https://twitter.com/essenciary
Active env: DEV
Ready!
Now start the server:
up()
┌ Info:
└ Web Server starting at http://127.0.0.1:8000
Genie.Server.ServersCollection(Task (failed) @0x00000001471f6770, nothing)
Using the url we get an error saying page not found. So I was wondering if anyone knows how to launch an app with Genie in Julia?
Most likely the port number is already in use which is a standard situation if you run
up()
more than once.The error message is not shown in the console but it is available in the object returned by up(). Simply get it into variable (or use the special
ans
variable having the last REPL result) and peek at the content ofwevserver
field