36 lines
496 B
Go
36 lines
496 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"embed"
|
|
"flag"
|
|
"net/http"
|
|
|
|
"git.nspix.com/golang/kos"
|
|
)
|
|
|
|
//go:embed web
|
|
var webDir embed.FS
|
|
|
|
type subServer struct {
|
|
}
|
|
|
|
func (s *subServer) Start(ctx context.Context) (err error) {
|
|
kos.Http().Root("/web", http.FS(webDir))
|
|
return
|
|
}
|
|
|
|
func (s *subServer) Stop() (err error) {
|
|
return
|
|
}
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
svr := kos.Init(
|
|
kos.WithName("git.nspix.com/golang/test", "0.0.1"),
|
|
kos.WithServer(&subServer{}),
|
|
kos.WithDirectHttp(),
|
|
)
|
|
svr.Run()
|
|
}
|