Vapor 3.0.0 正式发布,Swift 的 Web 框架和服务器

栏目: 软件资讯 · 发布时间: 8年前

内容简介:Vapor 3.0.0 已正式发布,这是一个重大改变的版本,3.0 对 Vapor 及其所有相关软件包进行了彻底的重写。 3.0 有三个重要的新功能: Async:Vapor 现在完全没有阻塞,并且可以在 Apple 的 SwiftNIO 上运行。 这意味...

Vapor 3.0.0 已正式发布,这是一个重大改变的版本,3.0 对 Vapor 及其所有相关软件包进行了彻底的重写。

3.0 有三个重要的新功能:

  • Async:Vapor 现在完全没有阻塞,并且可以在 Apple 的 SwiftNIO 上运行。 这意味着 Vapor 3 可以在您的应用程序需要时处理高级的并发情况

  • Services:JSON 配置文件已失效。由于 Vapor 新的依赖注入框架服务,现在一切都是 Swift

  • Codable:由于 Codable 集成在所有 Vapor 中,因此从 HTTP 消息解析和序列化内容、创建数据库模型以及渲染视图现在更安全,更高效

其他一些变化:

New:

  • Logger.reportError(...) is now public.

  • New convenience methods for encoding Content with status/headers (#1587).

  • AbortError now supports adding headers (#1397).

Fixed:

  • All APIs are now documented with doc blocks.

  • API surface minimized (everything made internal that can be).

  • HEAD requests are now properly handled (#1617).

  • ContentContainer is now more powerful (#1648).

  • map / flatMap now support implicit return types (#1606).

  • FileMiddleware is now non-blocking (#1586).

  • Bind to port 8080 even in production (#1455).

  • Tons of other small bug fixes and improvements.

更多更新内容请查看:https://medium.com/@codevapor/vapor-3-0-0-released-8356fa619a5d  
源码下载:https://github.com/vapor/vapor/releases/tag/3.0.0

Vapor 是一个 Swift 的 Web 开发框架,其灵感来自于 Laravel/Lumen 。支持 iOS、OS X 和 Ubuntu 系统。

特点:

  • 快速

  • 语法漂亮

  • 类型安全

示例代码:

Route.get("cookie") { request in
    let response = Response(status: .OK, text: "Cookie was set")
    response.cookies["test"] = "123"
    return response
}

【声明】文章转载自:开源中国社区 [http://www.oschina.net]


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Cracking the Coding Interview

Cracking the Coding Interview

Gayle Laakmann McDowell / CareerCup / 2015-7-1 / USD 39.95

Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and interviewed hund......一起来看看 《Cracking the Coding Interview》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

随机密码生成器
随机密码生成器

多种字符组合密码