Skip to content

Framework

Vapor

Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.

Overview

Vapor provides many of the parts needed for building full-featured applications.

For more details, check out the main docs.

Topics

Classes

  • Application
    Core type representing a Vapor application.
  • BCryptDigest
    Creates and verifies BCrypt hashes. Normally you will not need to initialize one of these classes and you will use the global BCrypt convenience instead.
  • BootCommand
    Boots the Application then exits successfully.
  • CORSMiddleware
    Middleware that adds support for CORS settings in request responses. For configuration of this middleware please use the CORSMiddleware.Configuration object.
  • EndpointCache
    Handles the complexities of HTTP caching.
  • ErrorMiddleware
    Captures all errors and transforms them into an internal server error HTTP response.
  • FileMiddleware
    Serves static files from a public directory.
  • HTTPServer
  • Request
    Represents an HTTP request in an application.
  • Response
    An HTTP response from a server back to the client.
  • Route
  • RouteLoggingMiddleware
    Emits a log message containing the request method and path to a Request’s logger. The log level of the message is configurable.
  • Routes
  • RoutesCommand
    Displays all routes registered to the Application’s Router in an ASCII-formatted table.
  • ServeCommand
    Boots the application’s server. Listens for SIGINT and SIGTERM for graceful shutdown.
  • Session
    Sessions are a method for associating data with a client accessing your app.
  • SessionsMiddleware
    Uses HTTP cookies to save and restore sessions for connecting clients.
  • TracingMiddleware
    Creates a trace and metadata for every request

Protocols

Structures

Variables

  • Bcrypt
    Creates and verifies BCrypt hashes.

Operators

  • !(_:)
    Inverts a Validationx`.
  • &&(_:_:)
    Combines two Validators using AND logic, succeeding if both Validators succeed without error.
  • +(_:_:)
    Unions two character sets.
  • ??(_:_:)
    Applies nil coalescing to a future’s optional and a concrete type.
  • ||(_:_:)
    Combines two Validators, succeeding if either of the Validators does not fail.

Type Aliases

Enumerations

Extended Modules