mirror of
https://github.com/doocs/md.git
synced 2025-01-22 20:04:39 +08:00
22 lines
310 B
Go
22 lines
310 B
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed assets
|
|
var assets embed.FS
|
|
|
|
func main() {
|
|
mutex := http.NewServeMux()
|
|
md, _ := fs.Sub(assets, "assets")
|
|
mutex.Handle("/", http.FileServer(http.FS(md)))
|
|
err := http.ListenAndServe(":80", mutex)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|