Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ handling logic.
)

func main() {
// The local development server is normally started from the command line, but
// certain IDE's support directly running go applications and the function won't
// be recognized.
//
// To resolve, set the "FUNCTION_TARGET" env variable directly to ensure the
// function is registered for the local server.
//
// err := os.Setenv("FUNCTION_TARGET", "HelloWorld")
// if err != nil {
// log.Fatalf("failed to set FUNCTION_TARGET: %v\n for local dev server", err)
// }

// Use PORT environment variable, or default to 8080.
port := "8080"
if envPort := os.Getenv("PORT"); envPort != "" {
Expand Down