mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: sqlite storage
This commit is contained in:
@@ -3,6 +3,7 @@ package driver
|
||||
import (
|
||||
"encoding/json"
|
||||
"ironmount/internal/constants"
|
||||
"ironmount/internal/db"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -24,12 +25,13 @@ func Create(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
db.CreateVolume(req.Name, volPath)
|
||||
|
||||
response := map[string]string{
|
||||
"Name": req.Name,
|
||||
"Mountpoint": volPath,
|
||||
"Err": "",
|
||||
}
|
||||
|
||||
volumes[req.Name] = Volume{Name: req.Name, Path: volPath}
|
||||
_ = json.NewEncoder(w).Encode(response)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user