mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: missing endpoints
This commit is contained in:
@@ -14,6 +14,7 @@ func Create(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
var req struct {
|
||||
Name string
|
||||
Opts map[string]string `json:"Opts,omitempty"`
|
||||
}
|
||||
_ = json.NewDecoder(r.Body).Decode(&req)
|
||||
|
||||
@@ -23,6 +24,12 @@ func Create(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
response := map[string]string{
|
||||
"Name": req.Name,
|
||||
"Mountpoint": volPath,
|
||||
"Err": "",
|
||||
}
|
||||
|
||||
volumes[req.Name] = Volume{Name: req.Name, Path: volPath}
|
||||
_ = json.NewEncoder(w).Encode(map[string]string{"Err": ""})
|
||||
_ = json.NewEncoder(w).Encode(response)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user