rawhat / mist

gleam HTTP server. because it glistens on a web
Apache License 2.0
260 stars 11 forks source link

Include protocol #23

Closed lpil closed 8 months ago

lpil commented 10 months ago

Hello!

In vscode I wanted to be able to click on the URL to visit the site, but I was unable without the protocol.

This could be incorrect if the programmer starts the server on HTTP. Perhaps this function could also take the scheme as a parameter?

rawhat commented 10 months ago

Sorry, I totally didn't see this! I think having it be after_start: fn(Int, String) -> Nil makes sense? Can just have start_http and start_https pass in the string literals there?

lpil commented 10 months ago

Would the Scheme type work? Or are there other values beyond Http and Https?

https://hexdocs.pm/gleam_http/gleam/http.html#Scheme

rawhat commented 10 months ago

Nope, that seems like a much better solution to me!