Swiftpack.co - vapor/vapor as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by vapor.
vapor/vapor 4.54.0
💧 A server-side Swift HTTP web framework.
⭐️ 21,163
🕓 Yesterday
iOS macOS watchOS tvOS linux macOS iOS
.package(url: "https://github.com/vapor/vapor.git", from: "4.54.0")

Vapor

Documentation Team Chat MIT License Continuous Integration Swift 5.2 Twitter


Vapor is an HTTP 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.

💛 Sponsors

Support Vapor's development by becoming a sponsor.

Broken Hands Monstarlab Transeo omrd Jari

💚 Backers

Support Vapor's development by becoming a backer.

analytics

GitHub

link
Stars: 21163
Last commit: Yesterday
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Adds default file support to FileMiddleware
Yesterday
This patch was authored by @NeedleInAJayStack and released by @0xTim.

Many HTTP servers support specifying a default file when a request hits a public directory. For example, a request to http://server.com/path/ may automatically serve the file at path/index.html.

This PR adds this functionality to the FileMiddleware via an initialization parameter. It defaults to disabled but can be customized to whatever default file name is desired. This default file name is also served automatically for all subdirectory queries. If the default file does not exist, the request is passed on to the next Responder.

A usage example:

// Default file serving is disabled
app.middleware.use(FileMiddleware(publicDirectory: "public/"))

// Serves `index.html` (if it exists) to a request to `http://server.com/`, as well as any subdirectories
app.middleware.use(FileMiddleware(publicDirectory: "public/", defaultFile: "index.html"))

Resolves: https://github.com/vapor/vapor/issues/2455

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics