Revert "Remove fastcgi feature" (#10081)
* Revert "Remove fastcgi feature (#9864)"
This reverts commit 90ed0ccdbe.
* revert fastcgi* annotations warning
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
---------
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
This commit is contained in:
parent
f1e3f2fa3c
commit
cccba35005
25 changed files with 975 additions and 159 deletions
30
images/fastcgi-helloserver/rootfs/main.go
Normal file
30
images/fastcgi-helloserver/rootfs/main.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/fcgi"
|
||||
)
|
||||
|
||||
func hello(w http.ResponseWriter, r *http.Request) {
|
||||
keys, ok := r.URL.Query()["name"]
|
||||
|
||||
if !ok || len(keys[0]) < 1 {
|
||||
fmt.Fprintf(w, "Hello world!")
|
||||
return
|
||||
}
|
||||
|
||||
key := keys[0]
|
||||
fmt.Fprintf(w, "Hello "+string(key)+"!")
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/hello", hello)
|
||||
|
||||
l, err := net.Listen("tcp", "0.0.0.0:9000")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fcgi.Serve(l, nil)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue