Vapor是一個基於Swift語言開源Web框架,可用於創建RESTful API、網站和使用WebSockets的實時應用。在核心框架之外,Vapor還提供了ORM 、模板語言,以及用戶身份驗證授權模塊。 [5]

Vapor
開發者Tanner Nelson and others
首次發布2016年1月18日,​8年前​(2016-01-18[1][2]
當前版本
  • 4.55.0 (2022年1月26日)[3]
編輯維基數據鏈接
程式語言Swift
作業系統macOS, Ubuntu
平台SwiftNIO
類型Web framework
許可協議MIT License
網站vapor.codes

Vapor的原始碼按照MIT許可證開源[6],並託管在GitHub。自2016年以來,Vapor一直是服務端Swift工作組的一部分。 [7][8]

歷史

編輯

僅在Apple於2015年12月3日開源Swift,並開始支持Linux的一個月後,Vapor就發布了0.1.0版本,證明Swift作為服務端語言的可行性。[9] Vapor 1.0發布於2016年9月[10],2.0發布於2017年5月[11]

在3.0版本,為了基於Swift的非阻塞網絡Vapor的框架SwiftNIO構建,Vapor框架進行了重寫。[12] Vapor 3於2018年5月發布。 Apple還在Swift.org介紹服務端應用的頁面上,引用了基於SwiftNIO的Vapor(以及Kitura)框架的速度數據。 [13]

在Vapor 3的測試階段,Packt 、[14][15][16] Paul Hudson、[17] Razeware LLC、[18]和lynda.com都發布了一些介紹Vapor的教程資料。 [19] 2018年5月[20],Swift官方論壇新增加的「相關項目」板塊,包含了Vapor相關的內容。

Vapor 4[21]的Alpha 1 Release始於2019年5月,穩定版發布於2020年4月。[22]

功能

編輯

Vapor包含下列功能: [23]

  • 異步/非阻塞 IO
  • HTTP認證:Basic認證、Bearer、JWT和基於密碼的認證
  • 緩存: Redis和機遇內存緩存
  • 命令行格式化
  • 內容協商:支持JSON、multipart和URL-encoded
  • 加密: RNG 、密碼、摘要、 RSA
  • 依賴注入和控制反轉[24]
  • ORM: 支持MySQL[25] PostgreSQLSQLite等資料庫
  • HTTP客戶端和伺服器
  • 頁面模版: HTML
  • 日誌
  • URL路由
  • 數據驗證
  • WebSocket客戶端和伺服器
  • 基於隊列的定時任務 

參考

編輯
  1. ^ Vapor 0.1.0 Release. 2016-01-25 [2018-04-03]. (原始內容存檔於2021-09-14). 
  2. ^ Server-side Swift Frameworks Comparison. [2018-05-24]. (原始內容存檔於2018-07-08). 
  3. ^ https://github.com/vapor/vapor/releases/tag/4.55.0; 檢索日期: 2022年2月4日.
  4. ^ Vapor 4.40.0 Release. 2021-02-09 [2021-02-15]. (原始內容存檔於2021-09-14). 
  5. ^ Vapor GitHub Organization. [2018-04-03]. (原始內容存檔於2022-04-28). 
  6. ^ vapor/vapor LICENSE at master. 2018-02-23 [2018-04-03]. (原始內容存檔於2021-01-22). 
  7. ^ Swift Server APIs. 2016-10-25 [2018-05-22]. (原始內容存檔於2021-05-10). 
  8. ^ Swift Blog: Server APIs Work Group. 2016-10-25 [2018-05-22]. (原始內容存檔於2022-03-01). 
  9. ^ Swift is Open Source. 2015-12-03 [2018-04-03]. (原始內容存檔於2022-04-24). 
  10. ^ Vapor 1.0.0 Release. 2016-09-15 [2018-04-03]. (原始內容存檔於2021-09-14). 
  11. ^ Vapor 2.0.0 Release. 2018-05-17 [2018-04-03]. (原始內容存檔於2022-04-30). 
  12. ^ Vapor 3.0.0 released. 2018-05-04 [2018-05-23]. (原始內容存檔於2022-05-16). 
  13. ^ Inc., Apple. Swift.org. Swift.org. [2018-10-04]. (原始內容存檔於2022-05-04) (英語). 
  14. ^ Patel, Ankur. Hands-On Full-Stack Development with Swift. Packt Publishing. 2018-03-30. ISBN 978-1788625241. 
  15. ^ 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.. Packt Publishing Ltd. 2018 [16 December 2019]. (原始內容存檔於2021-09-14). 
  16. ^ Kuepper, Ralph. Hands-On Swift 5 Microservice Development. Packt Publishing. 2020-03-12. ISBN 978-1789530889. 
  17. ^ Hudson, Paul. Server-Side Swift (Vapor Edition). 2018-03-01 [2021-09-14]. (原始內容存檔於2022-05-08). 
  18. ^ Condon, Tim; et al. Server Side Swift with Vapor. Razeware LLC. [2021-09-14]. (原始內容存檔於2020-09-24). 
  19. ^ Learning Server-Side Swift with Vapor. [2021-09-14]. (原始內容存檔於2021-05-09). 
  20. ^ Introducing Related Projects to Swift Forums. 2018-05-10 [2021-09-14]. (原始內容存檔於2021-09-14). 
  21. ^ VAPOR. Vapor 4: Alpha 1 Releases Begin. Medium. 2019-05-28 [2019-09-09]. (原始內容存檔於2021-09-14) (英語). 
  22. ^ Release Vapor 4.0.0 · vapor/vapor. GitHub. [2021-02-15]. (原始內容存檔於2021-09-14) (英語). 
  23. ^ Vapor Docs. docs.vapor.codes. [2018-05-22]. (原始內容存檔於2021-07-22) (英語). 
  24. ^ Elliot, Keith. Swift 3 New Features. Packt Publishing. 2016-10-06 [2021-09-14]. ISBN 978-1786462718. (原始內容存檔於2021-09-14). 
  25. ^ Hussain, Shaista; et al. Proceedings of the 2018 6th International Conference on Bioinformatics and Computational Biology. Association for Computing Machinery. 2018-03-12. ISBN 978-1-4503-6348-8.