Instance Methodhummingbird 2.3.0Hummingbird
addRoutes(_:atPath:)
Add route collection to router
RouteCollection.swift:63@discardableResult func addRoutes(_ collection: RouteCollection<Context>, atPath path: RouterPath = "") -> Self
Parameters
collection: Route collection
path: Root path to add routes to
Other members in extension
Instance members
func addMiddleware(buildMiddlewareStack: () -> some MiddlewareProtocol<Request, Response, Context>
) -> Self Add middleware stack 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 get(RouterPath, use: @escaping (Request, Context) async throws -> some ResponseGenerator
) -> Self GET 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 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