Classvapor 4.114.1Vapor
ServeCommand
Boots the application’s server. Listens for SIGINT
and SIGTERM
for graceful shutdown.
final class ServeCommand
$ swift run Run serve
Server starting on http://localhost:8080
Boots the application’s server. Listens for SIGINT
and SIGTERM
for graceful shutdown.
final class ServeCommand
$ swift run Run serve
Server starting on http://localhost:8080
import 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.
protocol AnyAsyncCommand : Sendable
A type-erased Command
.
protocol AsyncCommand : AnyAsyncCommand
A command that can be run through a Console
.
protocol Sendable
var help: String { get }
let signature: ServeCommand.Signature
func run(using context: CommandContext, signature: Signature) async throws
enum Error
Errors that may be thrown when serving a server
struct Signature
func outputAutoComplete(using context: inout CommandContext)
func outputHelp(using context: inout CommandContext)
func renderCompletionFunctions(using context: CommandContext, shell: Shell) -> String
func renderCompletionScript(using context: CommandContext, shell: Shell) -> String
Returns the complete contents of a completion script for the given shell
for self
and, recursively, all of its descendent subcommands.
func run(using context: inout CommandContext) async throws