Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hummingbird-project/hummingbird
Lightweight, flexible HTTP server framework written in Swift
https://github.com/hummingbird-project/hummingbird
http http-server server server-side-swift swift swift-nio web web-server
Last synced: 3 months ago
JSON representation
Lightweight, flexible HTTP server framework written in Swift
- Host: GitHub
- URL: https://github.com/hummingbird-project/hummingbird
- Owner: hummingbird-project
- License: apache-2.0
- Created: 2021-01-08T06:58:48.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-07T13:57:28.000Z (3 months ago)
- Last Synced: 2024-08-08T14:18:47.701Z (3 months ago)
- Topics: http, http-server, server, server-side-swift, swift, swift-nio, web, web-server
- Language: Swift
- Homepage:
- Size: 11.4 MB
- Stars: 955
- Watchers: 18
- Forks: 47
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
Lightweight, flexible, modern server framework written in Swift.
## Hummingbird
Hummingbird is a lightweight, flexible modern web application framework that runs on top of a SwiftNIO based server implementation. It is designed to require the minimum number of dependencies.
It provides a router for directing different endpoints to their handlers, middleware for processing requests before they reach your handlers and processing the responses returned, custom encoding/decoding of requests/responses, TLS and HTTP2.
```swift
import Hummingbird// create router and add a single GET /hello route
let router = Router()
router.get("hello") { request, _ -> String in
return "Hello"
}
// create application using router
let app = Application(
router: router,
configuration: .init(address: .hostname("127.0.0.1", port: 8080))
)
// run hummingbird application
try await app.runService()
```Hummingbird v2 is currently in development an [beta release](https://github.com/hummingbird-project/hummingbird/releases/tag/2.0.0-beta.2) is available if you'd like to try it out.
### Extending Hummingbird
Hummingbird is designed to require the least number of dependencies possible, but this means many features are unavailable to the core libraries. Additional features are provided through extensions. The Hummingbird repository comes with additional modules
- `HummingbirdRouter`: an alternative router that uses a resultbuilder.
- `HummingbirdTLS`: TLS support.
- `HummingbirdHTTP2`: Support for HTTP2 upgrades.
- `HummingbirdTesting`: helper functions to aid testing Hummingbird projects.And also the following are available in other repositories in this organisation
- [`HummingbirdAuth`](https://github.com/hummingbird-project/hummingbird-auth/tree/main): Authentication framework
- [`HummingbirdFluent`](https://github.com/hummingbird-project/hummingbird-fluent/tree/main): Integration with Vapor's database ORM [FluentKit](https://github.com/Vapor/fluent-kit).
- [`HummingbirdRedis`](https://github.com/hummingbird-project/hummingbird-redis/tree/main): Redis support via [RediStack](https://github.com/swift-server/RediStack).
- [`HummingbirdWebSocket`](https://github.com/hummingbird-project/hummingbird-websocket/tree/main): Support for WebSockets (Currently work in progess).
- [`HummingbirdLambda`](https://github.com/hummingbird-project/hummingbird-lambda/tree/main): Framework for running Hummingbird on AWS Lambdas.
- [`Jobs`](https://github.com/hummingbird-project/swift-jobs/tree/main): Job Queue Framework
- [`Mustache`](https://github.com/hummingbird-project/swift-mustache): Mustache templating engine.## Documentation
You can find reference documentation and user guides for Hummingbird [here](https://docs.hummingbird.codes/2.0/documentation/hummingbird/). The [hummingbird-examples](https://github.com/hummingbird-project/hummingbird-examples/tree/main) repository has a number of examples of different uses of the library.