ApacheExpress ✂️ mod_swift
Breaking news: A much enhanced ApacheExpress becomes its own project, separate from mod_swift.
May 31, 2017 | Read More |
Reliable Server Side Swift ✭ Make Apache great again!
ApacheExpress is a way to rapidly write reliable and feature rich web applications in the Swift programming language. Without ever leaving Xcode, or using the Swift Package Manager environment on Linux. ApacheExpress applications run directly within the Apache WebServer as native Apache modules - without any interpreters or proxies.
ApacheExpress can be used alongside any other Apache module and hence can exploit the proven functionality of Apache. This includes pretty much any kind of authentication mechanism you can think of, rate limiting / anti-DoS modules, or mod_ssl to secure the web application as well as mod_h2 to provide HTTP/2 support. The latter are preconfigured when running ApacheExpress modules and provide full HTTP/2 access out of the box.
Developing ApacheExpress applications use a Swift version of the mechanisms and APIs used by the Express.js framework. Hence its name. Example:
let app = apache.express(cookieParser(), session())
app.get("/express/cookies") { req, res, _ in
try res.json(req.cookies)
}
app.get("/express/") { req, res, _ in
let values = [
"viewCount" : req.session["viewCount"] ?? 0,
"cowOfTheDay" : cows.vaca()
]
try res.render("index", values)
}
It grabs the application object representing the module,
configures two builtin middleware objects (cookieParser
, session
)
and then registers two routes
(docs).
The middleware attached to the /express/cookies
route simply extracts all
HTTP cookies set in the request and returns them as JSON.
The other sets up a dictionary which is then rendered using a
Mustache template
(docs).
To provide access to a collection of SQL databases, including PostgreSQL and SQLite3, ApacheExpress uses the Apache mod_dbd module. Apache is used to configure the database connection and Apache is maintaining the database connection pool.
ApacheExpress then provides the mod_dbd middleware, which stacks the powerful ZeeQL database access framework on top of Apache’s module (docs).
ApacheExpress is still being prepared. Please stay tuned for the release. If you want to stay up to date, subscribe to the ApacheExpress Blog.
ApacheExpress documentation can be found here: docs.apacheexpress.io.
Breaking news: A much enhanced ApacheExpress becomes its own project, separate from mod_swift.
May 31, 2017 | Read More |
Running Swift server applications in a huge datacenter? That is for noobs. Running Swift server applications on a Raspberry Pi, that is 1337! And now you can …
April 21, 2017 | Read More |
As part of mod_swift we have been shipping mods_todomvc. Which is an implementation of a Todo-Backend, a simple JSON API to access and modify a list of todos. Today we take Todo-Backend one step further: Access the todos using CalDAV!
February 14, 2017 | Read More |
A feature of Apache 2 known to few is mod_dbd. Using that you can configure a SQL database connection within the Apache.conf and use that within all your Apache modules/handlers.
February 6, 2017 | Read More |
I am pleased to announce the first demo release of mod_swift! A neat way to write Apache modules in Swift.
January 25, 2017 | Read More |