Endpoints
What is an Endpoint?
struct CreateUserEndpoint
include Azu::Endpoint(CreateUserRequest, UserResponse)
post "/users"
def call : UserResponse
# Business logic here
end
endWhy Endpoints?
Traditional Approach Problems
Azu's Solution
Endpoint Components
1. Route Declaration
2. Request Contract
3. Response Contract
4. Call Method
Available Context
Request Access Pattern
Single Responsibility
Struct vs Class
Error Handling
Testing Endpoints
See Also
Last updated
Was this helpful?
