lesson1

command
v0.0.0-...-70b045a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2018 License: MIT Imports: 5 Imported by: 0

README

lesson1 homework

package main

import (
	"fmt"
	"net/http"
)

// http://localhost:8800/?user=pc
// 响应一个 hello pc

func handler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "<h1>hello %s!</h1>", r.URL)
}

func user_handler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "<h1>user %s!</h1>", r.URL)
}

func main() {
	http.HandleFunc("/", handler)
	http.HandleFunc("/user/", user_handler)
	http.ListenAndServe(":8800", nil)
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package main Package main provides ...
Package main Package main provides ...
c10k
one example to show the c10k problem.
one example to show the c10k problem.
xingxing
yueqing
yy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL