Skip to content

Server example wrongly applies healthcheck layer in B position #3607

@david-perez

Description

@david-perez

Our Pokemon service example applies AlbHealthCheckLayer in B position after routing. This is a bad example because health checks should run before routing, since typically they should not be modelled.

Docs for the aws_smithy_http_server::layer module explicitly mention that layers within it should wrap the router; it wouldn't hurt to link to A position middleware in the Rust book.

This appears to be a regression. When we created the module in #2865 the example worked as intended but when we introduced the generated config object we messed it up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersserverRust server SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions