Vapor 3.0.0 is officially released, a web framework and server for Swift

  

Vapor 3.0.0 has been officially released, a version with major changes, 3.0 is a complete rewrite of Vapor and all its related packages.

3.0 has three important new features:

  • Async : Vapor is now completely non-blocking and runs on Apple's SwiftNIO. This means Vapor 3 can handle advanced concurrency situations when your application needs it

  • Services : The JSON configuration file is invalid. Everything is now Swift thanks to Vapor's new dependency injection framework service

  • Codable : Since Codable is integrated in all Vapors, parsing and serializing content from HTTP messages, creating database models, and rendering views is now safer and more efficient

Some other changes:

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.

For more updates, please check: https://medium.com/@codevapor/vapor-3-0-0-released-8356fa619a5d  
Source code download: https://github.com/vapor/vapor/releases/tag/3.0. 0

Vapor is a Swift web development framework inspired by Laravel/Lumen. Supports iOS, OS X and Ubuntu systems.

Features:

  • fast

  • nice syntax

  • type safety

Sample code:

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325618026&siteId=291194637