INNER CODE UNIT · Go

listConnections

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

func listConnections(w http.ResponseWriter, r *http.Request) {
	opts := os.Getenv("MONGO_URIS")
	if opts == "" {
		opts = "[]"
	}
	w.Header().Set("Content-Type", "application/json")
	w.Write([]byte(opts))
}

type HTMLDir struct {
	d http.FileSystem
}

func (d HTMLDir) Open(name string) (http.File, error) {
	f, err := d.d.Open(name + ".html")
	if os.IsNotExist(err) {
		if f, err := d.d.Open(name); err == nil {
			return f, nil

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…