Vapor (web framework) explained
Vapor is an open source web framework written in Swift. It can be used to create RESTful APIs, web apps, and real-time applications using WebSockets. In addition to the core framework, Vapor provides an ORM, a templating language, and packages to facilitate user authentication and authorization.[4]
Vapor's source code is hosted on GitHub and licensed under the MIT License.[5] Vapor has been a part of Swift's Server APIs working group since 2016.[6] [7]
History
Vapor 0.1.0 was released as a proof of concept for Swift on the server a month after Apple open sourced Swift and began Linux platform support on December 3, 2015.[8] Vapor 1.0[9] arrived in September 2016, followed by the release of Vapor 2.0 in May 2017.[10]
The framework was rewritten for Vapor 3.0[11] to be built on Apple's non-blocking networking framework SwiftNIO. Vapor 3 was released in May 2018. Apple cited the speed with which Vapor (along with Kitura) adopted the new SwiftNIO framework on the main Swift.org server page.[12]
Vapor 3's beta period saw educational material published by Packt,[13] [14] [15] Paul Hudson,[16] Razeware LLC,[17] and lynda.com.[18] Vapor was recognized by Swift.org with an official Swift Forum in its inaugural group of Related Projects[19] in May 2018.
Vapor 4[20] 's Alpha 1 Release started in May 2019 and the stable version released in April 2020.[21]
Releases
Version | Release date | Swift version |
---|
| Sep 15, 2016 | ≥ 3.0 |
---|
| May 17, 2017 | ≥ 3.1 |
---|
| May 4, 2018 | ≥ 4.1 |
---|
| April 9, 2020 | ≥ 5.2 |
---|
| TBD | ≥ TBD |
---|
|
Source: Vapor Docs & GitHub Releases.[22] [23]
Swift version support
Vapor 4 supports the last 3 minor Swift versions. As of October 27th 2023, this includes Swift 5.7, Swift 5.8 and Swift 5.9.
This meets the standards set out by the Swift Server Workgroup,[24] of which Vapor is a member[25]
Features
Vapor supports the following features:[26]
- Async / non-blocking IO
- Authentication: basic, bearer, JWT, and password
- Cache: Redis and in-memory
- Commands / console formatting
- Content negotiation: JSON, multipart, and URL-encoded form
- Crypto: RNG, ciphers, digests, RSA
- Dependency Injection / Inversion of Control[27]
- Fluent ORM: MySQL,[28] PostgreSQL, MongoDB and SQLite
- HTTP client and server
- Leaf templating: HTML etc
- Logging
- URL routing
- Validation
- WebSocket client and server
- Queue jobs
Notes and References
- Web site: Vapor 0.1.0 Release. GitHub. 2016-01-25. 2018-04-03.
- Web site: Server-side Swift Frameworks Comparison. 2018-05-24.
- Web site: Vapor 4.102.1 Release. GitHub. 2023-07-10. 2024-07-23.
- Web site: Vapor GitHub Organization. GitHub. 2018-04-03.
- Web site: vapor/vapor LICENSE at master. GitHub. 2018-02-23. 2018-04-03.
- Web site: Swift Server APIs. 2016-10-25. 2018-05-22. 2021-05-10. https://web.archive.org/web/20210510193318/https://swift.org/server-apis/. dead.
- Web site: Swift Blog: Server APIs Work Group. 2016-10-25. 2018-05-22.
- Web site: Swift is Open Source. 2015-12-03. 2018-04-03.
- Web site: Vapor 1.0.0 Release. GitHub. 2016-09-15. 2018-04-03.
- Web site: Vapor 2.0.0 Release. GitHub. 2018-05-17. 2018-04-03.
- Web site: Vapor 3.0.0 released. 2018-05-04. 2018-05-23.
- Web site: Swift.org. Inc.. Apple. Swift.org. en. 2018-10-04.
- Book: Patel. Ankur. Hands-On Full-Stack Development with Swift. 2018-03-30. Packt Publishing. 978-1788625241.
- Book: Yeung . Angus . Hands-On Server-Side Web Development with Swift: Build dynamic web apps by leveraging two popular Swift web frameworks: Vapor 3.0 and Kitura 2.5. . 2018 . Packt Publishing Ltd . 9781789345865 . 16 December 2019.
- Book: Kuepper. Ralph. Hands-On Swift 5 Microservice Development. 2020-03-12. Packt Publishing. 978-1789530889.
- Book: Hudson. Paul. Server-Side Swift. 2018-03-01. Vapor.
- Book: Condon. etal. Tim. Server Side Swift with Vapor. Razeware LLC.
- Web site: Learning Server-Side Swift with Vapor. 2018-05-22. 2021-05-09. https://web.archive.org/web/20210509221704/https://www.lynda.com/Swift-tutorials/Learning-Server-Side-Swift-Vapor/560883-2.html. dead.
- Web site: Introducing Related Projects to Swift Forums. 2018-05-10.
- Web site: Vapor 4: Alpha 1 Releases Begin. VAPOR. 2019-05-28. Medium. en. 2019-09-09.
- Web site: Release Vapor 4.0.0 · vapor/vapor. 2021-02-15. GitHub. en.
- Web site: GitHub: vapor/vapor Releases. 2021-02-15. GitHub.
- Web site: Vapor Docs: Support. Vapor. 2018-05-04.
- Web site: Swift Server Workgoup.
- Web site: Swift Server Workgroup Members.
- Web site: Vapor Docs. docs.vapor.codes. en. 2018-05-22. 2021-07-22. https://web.archive.org/web/20210722151153/https://docs.vapor.codes/3.0/. dead.
- Book: Elliot. Keith. Swift 3 New Features. 2016-10-06. Packt Publishing. 978-1786462718.
- Book: Hussain. etal. Shaista. Proceedings of the 2018 6th International Conference on Bioinformatics and Computational Biology. 2018-03-12. Association for Computing Machinery. 978-1-4503-6348-8.