跳至內容

Vapor

維基百科,自由的百科全書
Vapor
開發者Tanner Nelson and others
首次發布2016年1月18日,​8年前​(2016-01-18[1][2]
當前版本4.40.0[3](2021年2月9日,​3年前​(2021-02-09
程式語言Swift
作業系統macOS, Ubuntu
平台SwiftNIO
類型Web framework
許可協議MIT License
網站vapor.codes

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

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

歷史

[編輯]

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

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

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

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

功能

[編輯]

Vapor包含下列功能: [22]

  • 異步/非阻塞 IO
  • HTTP認證:Basic認證、Bearer、JWT和基於密碼的認證
  • 緩存: Redis和機遇內存緩存
  • 命令行格式化
  • 內容協商:支持JSON、multipart和URL-encoded
  • 加密: RNG 、密碼、摘要、 RSA
  • 依賴注入和控制反轉[23]
  • ORM: 支持MySQL[24] 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. ^ Vapor 4.40.0 Release. 2021-02-09 [2021-02-15]. (原始內容存檔於2021-09-14). 
  4. ^ Vapor GitHub Organization. [2018-04-03]. (原始內容存檔於2022-04-28). 
  5. ^ vapor/vapor LICENSE at master. 2018-02-23 [2018-04-03]. (原始內容存檔於2021-01-22). 
  6. ^ Swift Server APIs. 2016-10-25 [2018-05-22]. (原始內容存檔於2021-05-10). 
  7. ^ Swift Blog: Server APIs Work Group. 2016-10-25 [2018-05-22]. (原始內容存檔於2022-03-01). 
  8. ^ Swift is Open Source. 2015-12-03 [2018-04-03]. (原始內容存檔於2022-04-24). 
  9. ^ Vapor 1.0.0 Release. 2016-09-15 [2018-04-03]. (原始內容存檔於2021-09-14). 
  10. ^ Vapor 2.0.0 Release. 2018-05-17 [2018-04-03]. (原始內容存檔於2022-04-30). 
  11. ^ Vapor 3.0.0 released. 2018-05-04 [2018-05-23]. (原始內容存檔於2022-05-16). 
  12. ^ Inc., Apple. Swift.org. Swift.org. [2018-10-04]. (原始內容存檔於2022-05-04) (英語). 
  13. ^ Patel, Ankur. Hands-On Full-Stack Development with Swift. Packt Publishing. 2018-03-30. ISBN 978-1788625241. 
  14. ^ 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). 
  15. ^ Kuepper, Ralph. Hands-On Swift 5 Microservice Development. Packt Publishing. 2020-03-12. ISBN 978-1789530889. 
  16. ^ Hudson, Paul. Server-Side Swift (Vapor Edition). 2018-03-01 [2021-09-14]. (原始內容存檔於2022-05-08). 
  17. ^ Condon, Tim; et al. Server Side Swift with Vapor. Razeware LLC. [2021-09-14]. (原始內容存檔於2020-09-24). 
  18. ^ Learning Server-Side Swift with Vapor. [2021-09-14]. (原始內容存檔於2021-05-09). 
  19. ^ Introducing Related Projects to Swift Forums. 2018-05-10 [2021-09-14]. (原始內容存檔於2021-09-14). 
  20. ^ VAPOR. Vapor 4: Alpha 1 Releases Begin. Medium. 2019-05-28 [2019-09-09]. (原始內容存檔於2021-09-14) (英語). 
  21. ^ Release Vapor 4.0.0 · vapor/vapor. GitHub. [2021-02-15]. (原始內容存檔於2021-09-14) (英語). 
  22. ^ Vapor Docs. docs.vapor.codes. [2018-05-22]. (原始內容存檔於2021-07-22) (英語). 
  23. ^ Elliot, Keith. Swift 3 New Features. Packt Publishing. 2016-10-06 [2021-09-14]. ISBN 978-1786462718. (原始內容存檔於2021-09-14). 
  24. ^ 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.