Implement POST /path?create=true for explicit repository creation

Legacy code which created repo on first "POST /keys/foo" remains, so
restic clients <= v0.3.3 continue working.
This commit is contained in:
Zlatko Čalušić
2017-01-25 20:59:18 +01:00
parent 2c90434911
commit 919add5012
2 changed files with 22 additions and 2 deletions

View File

@@ -70,6 +70,8 @@ func setupMux() *goji.Mux {
mux.HandleFunc(pat.Post("/:repo/:type/:name"), SaveBlob)
mux.HandleFunc(pat.Delete("/:type/:name"), DeleteBlob)
mux.HandleFunc(pat.Delete("/:repo/:type/:name"), DeleteBlob)
mux.HandleFunc(pat.Post("/"), CreateRepo)
mux.HandleFunc(pat.Post("/:repo"), CreateRepo)
return mux
}