-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print HTTP routes on deploy #568
Conversation
Seems to work! Just verified against the local installer: $ spin deploy
Successfully deployed application spin-hello-world version 1.0.0!
Application is running at spin-hello-world.spin-hello-world.local.fermyon.link
Available Routes:
hello: http://spin-hello-world.spin-hello-world.local.fermyon.link/hello
A simple component that returns hello.
$ curl -i http://spin-hello-world.spin-hello-world.local.fermyon.link/hello
HTTP/1.1 200 OK
Content-Length: 16
Date: Tue, 14 Jun 2022 13:35:11 GMT
Foo: bar
Content-Type: text/plain; charset=utf-8
Hello, Fermyon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested and it works! I have a few minor comments. Thank you!
examples/http-rust [itowlson-deploy-print-routes] $ spin deploy
Successfully deployed application spin-hello-world version 1.0.0!
Application is running at spin-hello-world.spin-hello-world.local.fermyon.link
Available Routes:
hello: http://spin-hello-world.spin-hello-world.local.fermyon.link/hello
A simple component that returns hello.
if let TriggerConfig::Http(http_cfg) = &component.trigger { | ||
let route = RoutePattern::from(base, &http_cfg.route); | ||
println!(" {}: http://{}{}", component.id, address, route); | ||
if let Some(description) = &component.description { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think removing the description might make the output cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this for consistency with the local printing of routes but can remove it if folks prefer!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah if we don't like the format it seems reasonable to change both (in a separate PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good
src/commands/deploy.rs
Outdated
println!("Application is running at {}", channel.domain); | ||
print_available_routes(&channel.domain, &http_config.base, &cfg); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println!("Application is running at {}", channel.domain); | |
print_available_routes(&channel.domain, &http_config.base, &cfg); | |
} | |
print_available_routes(&channel.domain, &http_config.base, &cfg); | |
} else { | |
println!("Application is running at {}", channel.domain); | |
} |
31cf40c
to
59aca76
Compare
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
59aca76
to
06449df
Compare
Fixes #566.
@michelleN I'm afraid I can't yet test this because I can't get the Hippo-Nomad stuff working correctly yet. I will try to get that sorted in the morning. If you have time do feel free to give this a quick test - I think it is right but am not sure in exactly what form Hippo returns the channel domain, so that at least is quite likely to be wrong! Sorry!