INNER CODE UNIT · Go

getFileSystem

aliez-ren/mongood · go/main.go:118

func getFileSystem() http.FileSystem {
	fsys, err := fs.Sub(root, "out")
	if err != nil {
		log.Fatal(err)
	}
	return HTMLDir{http.FS(fsys)}
}

func main() {
	ctx = context.Background()

	// serve root dir
	mux.Handle("/", gziphandler.GzipHandler(http.FileServer(getFileSystem())))

	// handle runCommand
	mux.Handle("/api/runCommand", gziphandler.GzipHandler(http.HandlerFunc(runCommand)))

	// handle listConnections

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…