Vapor Documentation

Class Application

public final class Application  

Core type representing a Vapor application.

%635 Application Application RoutesBuilder RoutesBuilder Application->RoutesBuilder

Nested Types

Application.Lifecycle
Application.Locks
Application.EventLoopGroupProvider
Application.Caches
Application.Clients
Application.Core
Application.Running
Application.HTTP
Application.Password
Application.Passwords
Application.Responder
Application.Servers
Application.Sessions
Application.Views

Conforms To

RoutesBuilder

Initializers

init(_:​_:​)

public init(
        _ environment: Environment = .development,
        _ eventLoopGroupProvider: EventLoopGroupProvider = .createNew
    )  

Properties

environment

public var environment: Environment

event​Loop​Group​Provider

public let eventLoopGroupProvider: EventLoopGroupProvider

event​Loop​Group

public let eventLoopGroup: EventLoopGroup

storage

public var storage: Storage

did​Shutdown

public private(set) var didShutdown: Bool

logger

public var logger: Logger

lifecycle

public var lifecycle: Lifecycle

locks

public var locks: Locks

sync

public var sync: Lock  

caches

public var caches: Caches  

Controls application's configured caches.

app.caches.use(.memory)

cache

public var cache: Cache  

Current application cache. See Request.cache for caching in request handlers.

clients

public var clients: Clients  

client

public var client: Client  

console

public var console: Console  

commands

public var commands: Commands  

thread​Pool

public var threadPool: NIOThreadPool  

The application thread pool. Vapor provides a thread pool with 64 threads by default.

It's possible to configure the thread pool size by overriding this value with your own thread pool.

application.threadPool = NIOThreadPool(numberOfThreads: 100)

If overriden, Vapor will take ownership of the thread pool and automatically start it and shut it down when needed.

fileio

public var fileio: NonBlockingFileIO  

allocator

public var allocator: ByteBufferAllocator  

running

public var running: Running?  

directory

public var directory: DirectoryConfiguration  

http

public var http: HTTP  

middleware

public var middleware: Middlewares  

password

public var password: Password  

passwords

public var passwords: Passwords  

responder

public var responder: Responder  

routes

public var routes: Routes  

servers

public var servers: Servers  

server

public var server: Server  

sessions

public var sessions: Sessions  

views

public var views: Views  

view

public var view: ViewRenderer  

Methods

run()

public func run() throws  

start()

public func start() throws  

boot()

public func boot() throws  

shutdown()

public func shutdown()  

add(_:​)

public func add(_ route: Route)