November 2018
Intermediate to advanced
404 pages
10h 16m
English
As mentioned earlier, the app object used in main.swift is actually created in the constructor function declared in app.swift:
// File: /Sources/App/app.swiftimport Vapor/// Creates an instance of Application. This is called from main.swift in the run target.public func app(_ : Environment) throws -> Application { // [1]var config = Config.default() // [2]var env = envvar services = Services.default() // [3]try configure(&config, &env, &services) // [4]let app = try Application(: config, : env, : services) // [5]try boot(app) // [6]return app}The preceding code sets up the sequence of calling several functions:
Read now
Unlock full access