November 2018
Intermediate to advanced
404 pages
10h 16m
English
main.swift is always contained in an executable target and cannot be imported by other modules:
// File: /Sources/Run/main.swiftimport App // [1]try app(.detect()).run() // [2]The preceding code does two things:
Vapor uses an Application instance, app, in every project to run a server and create other services. The instance is obtained from the app() function implemented in app.swift. Vapor avoids statically accessing the Application instance using this approach. It has no need to implement any locking mechanism for thread-safety that is required for static ...
Read now
Unlock full access