Write native Apache modules using Swift, enabling server-side Swift development within the battle-tested Apache HTTP Server.
mod_swift is a project that enables developers to write native modules for the Apache HTTP Server using the Swift programming language. It allows Swift code to run directly within Apache, providing high-performance dynamic content generation, web services, and server extensions without requiring a separate interpreter or proxy. The project includes ApacheExpress, a framework offering an Express-like API for building web applications.
Swift developers looking to build server-side applications or extend Apache's functionality, particularly those interested in integrating Swift with a proven, production-ready web server like Apache.
Developers choose mod_swift because it combines Swift's modern syntax and safety with Apache's battle-tested, modular architecture—offering HTTP/2, TLS, and database pooling out of the box, without reinventing the server stack.
Reliable Server Side Swift ✭ Make Apache great again!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Swift modules compile directly into Apache, behaving like C modules for high-performance request handling without interpreters or proxies.
ApacheExpress framework provides a Connect-style middleware interface, allowing familiar web app development patterns within Apache.
Leverages Apache's mod_dbd for connection pooling, supporting SQLite, PostgreSQL, and MySQL with minimal setup in configuration.
Built-in Mustache template engine enables dynamic HTML generation directly from Swift handlers, as shown in the demo code.
README explicitly states it's a technology demo with known issues like memory leaks and incomplete unloading, not intended for production use.
Requires manual Apache configuration, hacking Linux header files (e.g., adding typedefs), and hardcoded paths, making installation non-trivial.
Cannot use Swift Package Manager for dynamic libraries, restricting dependency management and modern Swift tooling adoption.