Body Parser Middleware for Slimane
Just register BodyParser into the middleware chains
import Slimane
import BodyParser
let app = Slimane()
app.use(BodyParser())
req.json
: Zewo.JSON
app.get("/") { req, _ in
print(req.json["user"])
}
req.formData
: [String: String]
app.get("/") { req, _ in
print(req.formData["user"])
}
import PackageDescription
let package = Package(
name: "SlimaneApp",
dependencies: [
.Package(url: "https://github.com/slimane-swift/BodyParser.git", majorVersion: 0, minor: 1)
]
)
BodyParser is released under the MIT license. See LICENSE for details.