macro-swift/macroapp
align="right" width="100" height="100" />
Example
MacroApp:
@main
struct HelloWorld: App {
var body: some Endpoints {
Use(logger("dev"), bodyParser.urlencoded())
Route("/admin") {
Get("/view") { req, res, _ in res.render("admin-index.html") }
Render("help", template: "help")
}
Get { req, res, next in
res.render("index.html")
}
}
}Instead of this traditional route setup (as in MacroExpress):
let app = express()
app.use(logger("dev"), bodyParser.urlencoded())
app.route("/admin")
.get("/view") { req, res, _ in res.render("admin-index.html") }
app.get("/") { req, res, _ in res.render("index.html") }
app.listen(1337) {
console.log("Server listening on http://localhost:1337")
}Environment Variables
macro.core.numthreadsmacro.core.iothreadsmacro.core.retain.debugmacro.concat.maxsizemacro.streams.debug.rcmacro.router.debugmacro.router.matcher.debug
Links
- MacroExpress
- Macro
- µExpress
- Noze.io
- SwiftNIO
- JavaScript Originals
- Connect - Express.js
- Swift Apache
Who
MacroExpress is brought to you by Helge Heß / ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.
There is a #microexpress channel on the Noze.io Slack. Feel free to join!
Package Metadata
Repository: macro-swift/macroapp
Default branch: main
README: README.md