summaryrefslogtreecommitdiff
path: root/src/bin/obnam-server.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-04-07 05:46:15 +0000
committerLars Wirzenius <liw@liw.fi>2022-04-07 05:46:15 +0000
commit8da3f80d296dc1891159fe4fdc1787cecd9730d0 (patch)
treef161b7958c3e6975d0bc2dbdef2bf3175e4d6216 /src/bin/obnam-server.rs
parent1c6ae813b00e46d2a8061fa480d1780124af1e64 (diff)
parent6defd70a2df0975ee22b09018a9dc709a7933200 (diff)
downloadobnam2-8da3f80d296dc1891159fe4fdc1787cecd9730d0.tar.gz
Merge branch 'liw/api-v1' into 'main'
feat! add chunk server API version to HTTP paths Closes #202 See merge request obnam/obnam!227
Diffstat (limited to 'src/bin/obnam-server.rs')
-rw-r--r--src/bin/obnam-server.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bin/obnam-server.rs b/src/bin/obnam-server.rs
index 5be2cee..6cf4122 100644
--- a/src/bin/obnam-server.rs
+++ b/src/bin/obnam-server.rs
@@ -47,27 +47,35 @@ async fn main() -> anyhow::Result<()> {
debug!("Configuration: {:#?}", config);
let create = warp::post()
+ .and(warp::path("v1"))
.and(warp::path("chunks"))
+ .and(warp::path::end())
.and(store.clone())
.and(warp::header("chunk-meta"))
.and(warp::filters::body::bytes())
.and_then(create_chunk);
let fetch = warp::get()
+ .and(warp::path("v1"))
.and(warp::path("chunks"))
.and(warp::path::param())
+ .and(warp::path::end())
.and(store.clone())
.and_then(fetch_chunk);
let search = warp::get()
+ .and(warp::path("v1"))
.and(warp::path("chunks"))
+ .and(warp::path::end())
.and(warp::query::<HashMap<String, String>>())
.and(store.clone())
.and_then(search_chunks);
let delete = warp::delete()
+ .and(warp::path("v1"))
.and(warp::path("chunks"))
.and(warp::path::param())
+ .and(warp::path::end())
.and(store.clone())
.and_then(delete_chunk);