Auto-create books directory, log upload errors, document Docker deployment
- library.New now creates BOOKS_DIR (MkdirAll) on startup so uploads don't fail when the directory is missing on a fresh bind mount - uploadSubmit logs the underlying OS error on save/write failures - README: document docker-compose deployment, container UID/GID (100/101) for bind-mounted ./data permissions, and running the admin CLI via docker compose exec Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+4
-1
@@ -21,7 +21,10 @@ func main() {
|
||||
}
|
||||
defer store.Close()
|
||||
|
||||
lib := library.New(booksDir)
|
||||
lib, err := library.New(booksDir)
|
||||
if err != nil {
|
||||
log.Fatalf("books dir: %v", err)
|
||||
}
|
||||
h := web.NewHandler(lib, store)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
Reference in New Issue
Block a user