Code Review
/
vpp.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
history
|
raw
|
HEAD
hs-test: shortened interface names to avoid character limit
[vpp.git]
/
extras
/
hs-test
/
tools
/
http_server
/
http_server.go
1
package main
2
3
import (
4
"fmt"
5
"io"
6
"net/http"
7
"os"
8
)
9
10
func main() {
11
if len(os.Args) < 2 {
12
fmt.Println("arg expected")
13
os.Exit(1)
14
}
15
16
http.HandleFunc("/httpTestFile", func(w http.ResponseWriter, r *http.Request) {
17
file, _ := os.Open("httpTestFile")
18
defer file.Close()
19
io.Copy(w, file)
20
})
21
err := http.ListenAndServe(os.Args[1], nil)
22
if err != nil {
23
fmt.Printf("%v\n", err)
24
os.Exit(1)
25
}
26
}