How vapor/vapor works
Vapor is a Swift HTTP framework for building websites, APIs, and cloud services. An application configures and runs a server; incoming HTTP requests are represented as Request values, passed through middleware and route handlers, and converted into responses. Content coders handle message bodies, while authentication, sessions, validation, views, caching, and outbound HTTP provide supporting capabilities. The README establishes the product scope; sampled source and the SOURCE INDEX support the central application, routing, middleware, content, and client relationships. Some server dispatch and unsampled capability wiring is shown only as unverified.
Main entry points: Application.swift Application · ContentConfiguration.swift Content coding · Request.swift Request · VaporHTTPClient.swift HTTP client
Components 21
Application Runtime
- Application
Sources/Vapor/Application.swift - HTTP server
Sources/Vapor/Server/Server.swift
HTTP Handling
- HTTP server handler
Sources/Vapor/HTTP/Server/HTTPServerHandler.swift - Request
Sources/Vapor/Request/Request.swift - Middleware chain
Sources/Vapor/Middleware/Middleware.swift - Route
Sources/Vapor/Routing/Route.swift - Responder
Sources/Vapor/HTTP/Responder.swift - Response
Sources/Vapor/Response/Response.swift
Content and Views
- Content coding
Sources/Vapor/Content/ContentConfiguration.swift - Content API
Sources/Vapor/Content/Content.swift - View rendering
Sources/Vapor/View/ViewRenderer.swift
Application Services
- Authentication
Sources/Vapor/Authentication/Authentication.swift - Sessions
Sources/Vapor/Sessions/SessionsMiddleware.swift - Cache
Sources/Vapor/Cache/Cache.swift - HTTP client
Sources/Vapor/HTTP/Client/VaporHTTPClient.swift - Client request
Sources/Vapor/Client/ClientRequest.swift - Client response
Sources/Vapor/Client/ClientResponse.swift
Developer API
- Route registration
Sources/Vapor/Routing/RoutesBuilder+Method.swift - Validation
Sources/Vapor/Validation/Validations.swift
Other components
- Application developer
- HTTP caller
Connections 26
- Application developer → Application: configures
Sources/Vapor/Application.swift - Application → HTTP server: runs
Sources/Vapor/Application.swift - HTTP caller → HTTP server: sends HTTP
- HTTP server → HTTP server handler: dispatches
- HTTP server handler → Request: creates
- Request → Middleware chain: enters chain
Sources/Vapor/Middleware/Middleware.swift - Middleware chain → Responder: chains to
Sources/Vapor/Middleware/Middleware.swift - Application developer → Route registration: registers routes
Sources/Vapor/Routing/RoutesBuilder+Method.swift - Route registration → Route: adds
Sources/Vapor/Routing/RoutesBuilder+Method.swift - Route → Responder: dispatches
Sources/Vapor/Routing/Route.swift - Responder → Response: returns
Sources/Vapor/HTTP/Responder.swift - Application → Content coding: configures
Sources/Vapor/Application.swift - Content API → Content coding: uses coders
Sources/Vapor/Content/Content.swift - Request → Content coding: decodes body
Sources/Vapor/Request/Request.swift - Response → Content coding: encodes body
Sources/Vapor/Response/Response.swift - Application → View rendering: configures
Sources/Vapor/Application.swift - Application → Cache: configures
Sources/Vapor/Application.swift - Application → HTTP client: configures
Sources/Vapor/Application.swift - Application → Sessions: configures
Sources/Vapor/Application.swift - Request → Authentication: provides access
Sources/Vapor/Request/Request.swift - Request → Sessions: provides access
- Application developer → Validation: validates input
- HTTP client → Client request: sends
Sources/Vapor/HTTP/Client/VaporHTTPClient.swift - HTTP client → Client response: produces
Sources/Vapor/HTTP/Client/VaporHTTPClient.swift - Client request → Content coding: encodes content
Sources/Vapor/Client/ClientRequest.swift - Client response → Content coding: decodes content
Sources/Vapor/Client/ClientResponse.swift