New:
- Programmatically configure servers
clients.json
for TLS configurationrequest.lang
to access Accept-Language
Better:
- Simplified Droplet configuration
drop.addProvider
drop.addConfigurable
- Expanded
drop.view.make
context support. - More flexible Provider API
boot(_ drop: Droplet)
- 500 errors are logged in production mode.
Fixed:
- TLS server crashes
Migration guide
Vapor projects running 1.0 will continue to compile with 1.1, but you may see new deprecation warnings. Here's how to update your code:
Droplet Config
In 1.1, almost all properties on the Droplet are variable. This makes configuring the Droplet a lot easier and removes dependence on large init calls.
let drop = Droplet(
console: myConsole,
availableMiddleware: ["my-middleware": myMiddleware],
providers: [MyProvider.self],
preparations: [MyPreparation.self]
)
The Droplet can now be configured manually
let drop = Droplet()
try drop.addProvider(MyProvider.self)
drop.console = myConsole
drop.middleware.append(myMiddleware)
drop.preparations.append(MyPreparations.self)
Or with configuration in mind.
let drop = Droplet()
try drop.addProvider(MyProvider.self)
drop.addConfigurable(console: myConsole, name: "my-console")
drop.addConfigurable(middleware: myMiddleware, name: "my-middleware")
drop.preparations.append(MyPreparations.self)
Read more about these updates in the Droplet section of the docs.
Additionally, take a look at the updated basic-template
Especially the pull request converting the basic-template from 1.0, to 1.1.