TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Execute Gin, Iris, Gorilla or Whatever Else on AWS Lambda Seamlessly
2 points
by
fsenart
over 8 years ago
Before:<p><pre><code> package main import ( "net/http" "github.com/gin-gonic/gin" ) var r *gin.Engine func handle(ctx *gin.Context) { ctx.String(http.StatusOK, "Hello, %s!", ctx.Param("name")) } func init() { r = gin.Default() r.GET("/hello/:name", handle) } func main() { r.Run(":8080") } </code></pre> After:<p><pre><code> package main import ( "net/http" "github.com/eawsy/aws-lambda-go-net/service/lambda/runtime/net" "github.com/gin-gonic/gin" ) var r *gin.Engine func handle(ctx *gin.Context) { ctx.String(http.StatusOK, "Hello, %s!", ctx.Param("name")) } func init() { r = gin.Default() r.GET("/hello/:name", handle) go http.Serve(net.Listener(), r) } func main() { } </code></pre> Spot the difference :)<p>BTW https://github.com/eawsy/aws-lambda-go-net
no comments
no comments