Skip to content

Instantly share code, notes, and snippets.

@shrmpy
Created November 19, 2021 07:04
Show Gist options
  • Save shrmpy/ab950a1ee78235c2bf28146434f208e9 to your computer and use it in GitHub Desktop.
Save shrmpy/ab950a1ee78235c2bf28146434f208e9 to your computer and use it in GitHub Desktop.
refactor init and lambda.Start with the addition of middleware
var conf *ebs.Config
func init() {
conf = ebs.NewConfig()
secret := os.Getenv("EXTENSION_SECRET")
helper = newService(decodeSecret(secret))
}
func main() {
lambda.Start(
ebs.MiddlewareCORS(conf,
handler,
),
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment