Instance Methodhummingbird 2.2.0Hummingbird
get(_:use:)
GET path for async closure returning type conforming to ResponseGenerator
RouterMethods.swift:108@discardableResult func get(_ path: RouterPath = "", use handler: @escaping (Request, Context) async throws -> some ResponseGenerator) -> Self
Other members in extension
Instance members
func addMiddleware(buildMiddlewareStack: () -> some MiddlewareProtocol<Request, Response, Context>
) -> Self Add middleware stack to router
func addRoutes(RouteCollection<Context>, atPath: RouterPath
) -> Self Add route collection to router
func delete(RouterPath, use: @escaping (Request, Context) async throws -> some ResponseGenerator
) -> Self DELETE path for async closure returning type conforming to ResponseGenerator
func group(RouterPath
) -> RouterGroup<Context> Return a group inside the current group
func group<TargetContext>(RouterPath, context: TargetContext.Type
) -> RouterGroup<TargetContext> Return a group inside the current group that transforms the
RequestContext
func head(RouterPath, use: @escaping (Request, Context) async throws -> some ResponseGenerator
) -> Self HEAD path for async closure returning type conforming to ResponseGenerator
func on(RouterPath, method: HTTPRequest.Method, use: @escaping (Request, Context) async throws -> some ResponseGenerator
) -> Self Add path for async closure
func patch(RouterPath, use: @escaping (Request, Context) async throws -> some ResponseGenerator
) -> Self PATCH path for async closure returning type conforming to ResponseGenerator
func post(RouterPath, use: @escaping (Request, Context) async throws -> some ResponseGenerator
) -> Self POST path for async closure returning type conforming to ResponseGenerator
func put(RouterPath, use: @escaping (Request, Context) async throws -> some ResponseGenerator
) -> Self PUT path for async closure returning type conforming to ResponseGenerator