Add network device driver model, netdev

This commit is contained in:
Scott Feldman
2023-03-28 12:18:59 -07:00
committed by Ron Evans
parent 00b1b4fbfb
commit 276feecc20
128 changed files with 6389 additions and 15539 deletions
+38
View File
@@ -0,0 +1,38 @@
// This example is an HTTP server serving up a static file system
//
// Note: It may be necessary to increase the stack size when using "net/http".
// Use the -stack-size=4KB command line option.
package main
import (
"embed"
"log"
"net/http"
"time"
)
var (
ssid string
pass string
port string = ":80"
)
//go:embed index.html main.go images
var fs embed.FS
func main() {
// wait a bit for console
time.Sleep(2 * time.Second)
if err := netdev.NetConnect(); err != nil {
log.Fatal(err)
}
hfs := http.FileServer(http.FS(fs))
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
hfs.ServeHTTP(w, r)
})
log.Fatal(http.ListenAndServe(port, nil))
}