Skip to content

Instantly share code, notes, and snippets.

@dimavs
Created September 16, 2010 13:36
Show Gist options
  • Save dimavs/582432 to your computer and use it in GitHub Desktop.
Save dimavs/582432 to your computer and use it in GitHub Desktop.
package main
import "runtime";
import "http";
import "io";
func HelloServer(c *http.Conn, req *http.Request) {
io.WriteString(c, "hello, world!\n");
}
func main() {
runtime.GOMAXPROCS(2); // dual core
http.Handle("/", http.HandlerFunc(HelloServer));
http.ListenAndServe(":8080", nil);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment