knight - HTTP 服务器
BSD
跨平台
Google Go
软件简介
knight 是一个 Go 语言写的 HTTP 服务器,支持自动重载功能,就是可以自动检测文件的改变并根据需要重启服务器。
用法:
package main
import (
"fmt"
"net/http"
"github.com/fengsp/knight"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "It works!")
}
func main() {
http.HandleFunc("/", handler)
// pass your root path in
knight := knight.NewKnight("/private/tmp/test")
knight.ListenAndServe(":8000", nil)
}