Created
January 22, 2018 02:13
-
-
Save mweagle/b81d0b53b5ae84c05dff185ae352ccbf to your computer and use it in GitHub Desktop.
sparta_old_model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// filename: cmd/main.go | |
package main | |
import ( | |
“io” | |
“net/http” | |
“os” | |
sparta “github.com/mweagle/Sparta” | |
) | |
// http.HandlerFunc style | |
func helloWorld(w http.ResponseWriter, r *http.Request) { | |
io.WriteString(w, “Hello World”) | |
} | |
//////////////////////////////////////////////////////////////////////////////// | |
// Main | |
func main() { | |
lambdaFn := sparta.HandleAWSLambda(“Hello World”, | |
http.HandlerFunc(helloWorld), | |
sparta.IAMRoleDefinition{}) | |
var lambdaFunctions []*sparta.LambdaAWSInfo | |
lambdaFunctions = append(lambdaFunctions, lambdaFn) | |
err := sparta.Main(“Hello World”, | |
“Hello World”, | |
lambdaFunctions, | |
nil, | |
nil) | |
if err != nil { | |
os.Exit(1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment