Skip to content

Commit

Permalink
Improve server open_browser feature
Browse files Browse the repository at this point in the history
  • Loading branch information
essenciary committed Nov 15, 2023
1 parent 9f57cfc commit ec5c1ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Genie"
uuid = "c43c736e-a2d1-11e8-161f-af95117fbd1e"
authors = ["Adrian Salceanu <[email protected]>"]
version = "5.21.2"
version = "5.22.0"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
7 changes: 6 additions & 1 deletion src/Server.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ function up(port::Int,
open_browser::Bool = false,
reuseaddr::Bool = Distributed.nworkers() > 1,
updateconfig::Bool = true,
protocol::String = "http",
query::Dict = Dict(),
http_kwargs...) :: ServersCollection

if server !== nothing
Expand Down Expand Up @@ -127,7 +129,10 @@ function up(port::Int,
end
end

server_url = "http://$host:$port"
server_url = "$protocol://$host:$port"
if ! isempty(query)
server_url *= ("?" * join(["$(k)=$(v)" for (k, v) in query], "&"))
end

status = if async
print_server_status("Web Server starting at $server_url")
Expand Down

2 comments on commit ec5c1ee

@essenciary
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95396

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v5.22.0 -m "<description of version>" ec5c1ee49c81869fed815a90d5cc05707fd40317
git push origin v5.22.0

Please sign in to comment.