TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Execute Gin, Iris, Gorilla or Whatever Else on AWS Lambda Seamlessly

2 pointsby fsenartover 8 years ago
Before:<p><pre><code> package main import ( &quot;net&#x2F;http&quot; &quot;github.com&#x2F;gin-gonic&#x2F;gin&quot; ) var r *gin.Engine func handle(ctx *gin.Context) { ctx.String(http.StatusOK, &quot;Hello, %s!&quot;, ctx.Param(&quot;name&quot;)) } func init() { r = gin.Default() r.GET(&quot;&#x2F;hello&#x2F;:name&quot;, handle) } func main() { r.Run(&quot;:8080&quot;) } </code></pre> After:<p><pre><code> package main import ( &quot;net&#x2F;http&quot; &quot;github.com&#x2F;eawsy&#x2F;aws-lambda-go-net&#x2F;service&#x2F;lambda&#x2F;runtime&#x2F;net&quot; &quot;github.com&#x2F;gin-gonic&#x2F;gin&quot; ) var r *gin.Engine func handle(ctx *gin.Context) { ctx.String(http.StatusOK, &quot;Hello, %s!&quot;, ctx.Param(&quot;name&quot;)) } func init() { r = gin.Default() r.GET(&quot;&#x2F;hello&#x2F;:name&quot;, handle) go http.Serve(net.Listener(), r) } func main() { } </code></pre> Spot the difference :)<p>BTW https:&#x2F;&#x2F;github.com&#x2F;eawsy&#x2F;aws-lambda-go-net

no comments

no comments