golang的最简单的文件浏览web服务器

网上看到的,记录下,备用

package main

import (
    "net/http"
)

func main() {
    http.Handle("/", http.FileServer(http.Dir("./")))
    http.ListenAndServe(":8080", nil)
}

 

posted @ 2014-07-01 12:37  自由出土文物  阅读(1402)  评论(0编辑  收藏  举报