Swiftpack.co - Package - vapor/vapor

Vapor

Documentation Team Chat MIT License Continuous Integration Swift 5.1 Twitter


Vapor is a web framework for Swift. It provides a beautifully expressive and easy to use foundation for your next website, API, or cloud project.

Take a look at some of the awesome stuff created with Vapor.

💧 Community

Join the welcoming community of fellow Vapor developers on Discord.

🚀 Contributing

To contribute a feature or idea to Vapor, create an issue explaining your idea or bring it up on Discord.

If you find a bug, please create an issue.

If you find a security vulnerability, please contact security@vapor.codes as soon as possible.

💙 Code of Conduct

Our goal is to create a safe and empowering environment for anyone who decides to use or contribute to Vapor. Please help us make the community a better place by abiding to this Code of Conduct during your interactions surrounding this project.

🏫 Tutorials

The awesome Vapor community is always adding new tutorials and articles out there, Vapor University is a great place to get started!

👥 Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

🥇 Sponsors

Proudly sponsored by Nodes (🏅), Skelpo (🥉), and our Open Collective sponsors.

Nodes
Skelpo

Michael Dominick

analytics

Github

link
Stars: 17173
Help us keep the lights on

Releases

3.3.1 - Sep 18, 2019

Semver Patch release

  • Fix: Identifier not used in Abort init (#1923 @mikkelu)
  • Use FoundationNetworking on Linux for Swift 5.1 (#2028 @joscdk)

4.0.0-alpha.3.1.1 - Aug 29, 2019

  • Fixes a bug preventing --port, --host, and --bind overrides from being passed to the HTTP server. (#2043)

Notes: Prior to this fix, the console output would display the correct hostname and port, but the server would still bind to default hostname and port.

4.0.0-alpha.3.1 - Aug 27, 2019

Notes: This updated ConsoleKit release includes property wrapper support and internal cleanup. Vapor's ServeCommand, BootCommand, RouteCommand, and --env and --log flags have been updated to use the new syntax.

4.0.0-alpha.3 - Aug 26, 2019

  • Request no longer requires a Channel to init. Now, it requires an EventLoop and SocketAddress?. (#2037)

Note: This makes testing a Request easier since you can pass in either EmbeddedEventLoop or a real event loop from a group used elsewhere in your tests. Prior to this change, you were required to use EmbeddedChannel and EmbeddedEventLoop both of which are incompatible with real event loops.

  • Fixed a data race accessing Application.running. (#2027, #2037)

Note: Application.running allows you to programmatically shutdown your HTTP server from anywhere that you can access Application. This includes routes, commands, etc. Because this can be accessed from any thread, it required synchronization (NSLock) to access.

  • XCTApplication test helpers now require explicit start / shutdown. (#2037)

Note: Although a bit more verbose, explicitly starting and shutting down test helpers gives the user more options for how they test their application. It also cuts down on edge cases in the testing implementation.

Example from Vapor's tests with explicit start / shutdown:

let app = Application.create(routes: { r, c in
    r.get("hello", ":a") { req in
        return req.parameters.get("a") ?? ""
    }

    r.get("hello", ":a", ":b") { req in
        return [req.parameters.get("a") ?? "", req.parameters.get("b") ?? ""]
    }
})
defer { app.shutdown() }

let server = try app.testable().start()
defer { server.shutdown() }

try server.test(.GET, "/hello/vapor") { res in
    XCTAssertEqual(res.status, .ok)
    XCTAssertContains(res.body.string, "vapor")
}.test(.POST, "/hello/vapor") { res in
    XCTAssertEqual(res.status, .notFound)
}.test(.GET, "/hello/vapor/development") { res in
    XCTAssertEqual(res.status, .ok)
    XCTAssertEqual(res.body.string, #"["vapor","development"]"#)
}
  • Fixed an issue causing Request.query.get / Request.query.subscript to crash. (#2018)

4.0.0-alpha.2.1 - Aug 22, 2019

Fixed:

  • Fixed a compile time error due to changes in AsyncHTTPClient alpha 2.