Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Add helloweb snippet#1113

Merged
ramya-rao-a merged 1 commit intomicrosoft:masterfrom
thomasdarimont:feature/helloweb-snippet
Jul 27, 2017
Merged

Add helloweb snippet#1113
ramya-rao-a merged 1 commit intomicrosoft:masterfrom
thomasdarimont:feature/helloweb-snippet

Conversation

@thomasdarimont
Copy link
Copy Markdown
Contributor

helloweb generates small web app with an http endpoint
which returns a greeting and the current time.

This is can be used to quickly generate a minimal web app
for demo purposes.

The generated code looks like:

package main

import (
	"fmt"
	"net/http"
	"time"
)

func greet(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "Hello World! %s", time.Now())
}

func main() {
	http.HandleFunc("/", greet)
	http.ListenAndServe(":8080", nil)
}

`helloweb` generates small web app with an http endpoint
which returns a greeting and the current time.

This is can be used to quickly generate a minimal web app
for demo purposes.
@msftclas
Copy link
Copy Markdown

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@msftclas
Copy link
Copy Markdown

@thomasdarimont, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request.

Thanks, Microsoft Pull Request Bot

@ramya-rao-a ramya-rao-a merged commit 4f33a07 into microsoft:master Jul 27, 2017
@ramya-rao-a
Copy link
Copy Markdown
Contributor

This snippet is now out in the latest update to the Go extension 0.6.64

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants