Replies: 2 comments
-
I think the fix for api gateway stage name is pretty simple, we can nest everything inside of a route matching the stage name. example below. #[tokio::main]
async fn main() -> Result<(), Error> {
if std::env::var_os("RUST_LOG").is_none() {
std::env::set_var("RUST_LOG", "poem=debug");
}
tracing_subscriber::fmt::init();
let app = Route::new()
.at("/", get(simple))
.at("/pet", get(pet))
.at("/hello/:name", get(hello));
let stage_name = String::from("/prod");
let server = Route::new().nest(stage_name, app);
run(server).await
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you so much! 🙂 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bit strapped for time so I explained the issue in the loom video.
poem/main.rs at master · poem-web/poem - 16 May 2022 - Watch Video
Basically the examples for lambda-hello-world shows that we set up routing without the AWS ApiGateway stage name. However, in practice, the stage name needs to be included in the routing for the requests to resolve correctly.
By the way, I think this is a pretty awesome library. :) Great work.
Beta Was this translation helpful? Give feedback.
All reactions