上QQ阅读APP看书,第一时间看更新
What is Vapor?
Vapor is a Swift package that provides the APIs to build a web application. It consists of several Swift packages, and, contrary to what most people might think, Vapor is not a monolithic Swift package. It is rather small and modular, consisting of several Swift packages that are stitched together to create a very rich web framework. The Swift packages it depends on are created by the Vapor team and grouped together based on their functionality. So, anyone who wants to build their own web framework in Swift can do so by consuming these packages. Vapor is broken down into the following packages:
- core: The core package contains core extensions, type-aliases, and functions that facilitate common tasks
- bits: This is a small package to help deal with bytes
- debugging: This package aids Vapor users in better debugging around the framework
- random: This package is useful for generating random bytes and numbers
- bcrypt: This package contains Swift implementation of the BCrypt password hashing function
- crypto: This package contains Swift implementation of cryptography functions
- tls: This package is a wrapper for OpenSSL and TLS
- sockets: This package provides a pure Swift (POSIX) TCP and UDP non-blocking socket layer, with event-driven server and client
- node: This package is a formatted data encapsulation, meant to facilitate the transformation from one object to another
- json: This package is a convenience wrapper for Foundation JSON
- console: This package is the good wrapper around console I/O
- engine: This package provides non-blocking networking for Swift (HTTP and WebSockets)
- routing: This package provides type-safe generic HTTP routing
- multipart: This package contains modules that parse and serialize multi-part/mixed and multi-part/form-data content types
- sqlite: This package is a Swift wrapper for SQLite 3
- fluent: This package is a Swift ORM (queries, models, and relations) for NoSQL and SQL databases
- vapor: This is a server-side Swift web framework that builds on top of all of the preceding packages
Here is a visualization of these packages and their relationships to each other: