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.