github.com/whiteboxio/flow@v0.0.3-0.20190918184116-508d75d68a2c/web/app/agent/static.go (about)

     1  package agent
     2  
     3  import (
     4  	"net/http"
     5  
     6  	core "github.com/awesome-flow/flow/pkg/corev1alpha1"
     7  )
     8  
     9  func init() {
    10  	RegisterWebAgent(
    11  		func(*core.Context) (WebAgent, error) {
    12  			return &DummyWebAgent{
    13  				"/static/",
    14  				http.StripPrefix("/static/", http.FileServer(http.Dir("./web/static"))),
    15  			}, nil
    16  		},
    17  	)
    18  	RegisterWebAgent(
    19  		func(*core.Context) (WebAgent, error) {
    20  			return &DummyWebAgent{
    21  				"/favicon.ico",
    22  				http.FileServer(http.Dir("./web/static/img")),
    23  			}, nil
    24  		},
    25  	)
    26  }