Bump to latest dep versions Including the Lambda runtime 0.5.2 and the latest SwiftNIO, which implies Swift 5.5.2+.
Bump to latest dep versions
Including the Lambda runtime 0.5.2 and the latest SwiftNIO, which implies Swift 5.5.2+.
AWS Lambda API Gateway Support for Macro and MacroExpress (and all things built on-top).
It allows deployment of arbitrary Macro applications as AWS Lambda functions, including MacroApp endpoints.
Blog article: Deploying Swift on AWS Lambda.
The module is split into the MacroLambda module, which provides the Express runner (Lambda.run(express-app)) and MacroLambdaCore which only links against http and provides the lambda.createServer (the peer to http.createServer).
MacroLambda
Lambda.run(express-app)
MacroLambdaCore
http
lambda.createServer
http.createServer
There is a tutorial on getting started with those things: Create your first HTTP endpoint with Swift on AWS Lambda.
Note: The Swift Lambda Runtime requires Swift 5.2.
import MacroLambda let app = Express() app.use(bodyParser.text()) app.post("/hello") { req, res, next in console.log("Client posted:", req.body.text ?? "-") res.send("Client body sent: \(req.body.text ?? "~nothing~")") } app.get { req, res, next in res.send("Welcome to Macro!") } Lambda.run(app)
Using swift lambda (brew install SPMDestinations/tap/swift-lambda):
swift lambda
brew install SPMDestinations/tap/swift-lambda
$ swift lambda deploy -d 5.2
Tutorial available: Deploying Swift on AWS Lambda.
macro.core.numthreads
macro.core.iothreads
macro.core.retain.debug
macro.concat.maxsize
macro.streams.debug.rc
Macro is brought to you by the Always Right Institute and 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!
#microexpress
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
MacroLambda
AWS Lambda API Gateway Support for Macro and MacroExpress (and all things built on-top).
It allows deployment of arbitrary Macro applications as AWS Lambda functions, including MacroApp endpoints.
Blog article: Deploying Swift on AWS Lambda.
The module is split into the
MacroLambda
module, which provides the Express runner (Lambda.run(express-app)
) andMacroLambdaCore
which only links againsthttp
and provides thelambda.createServer
(the peer tohttp.createServer
).There is a tutorial on getting started with those things: Create your first HTTP endpoint with Swift on AWS Lambda.
Note: The Swift Lambda Runtime requires Swift 5.2.
Example
Deployment
Using
swift lambda
(brew install SPMDestinations/tap/swift-lambda
):Tutorial available: Deploying Swift on AWS Lambda.
Environment Variables
macro.core.numthreads
macro.core.iothreads
macro.core.retain.debug
macro.concat.maxsize
macro.streams.debug.rc
Links
Who
Macro is brought to you by the Always Right Institute and 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!