Skip to content

Commit

Permalink
[feat] Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ppodolsky committed Apr 27, 2024
1 parent be2407e commit b4950cd
Show file tree
Hide file tree
Showing 4 changed files with 639 additions and 18 deletions.
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ async fn app() -> Result<(), Error> {
let mut router = Router::new()
.route("/blobs/:hash", get(blobs_get))
.route("/tables/", get(tables_ls))
.route("/tables/foreign_insert/", post(table_foreign_insert))
.route("/tables/:table/", post(tables_create))
.route("/tables/:table/exists/", get(tables_exists))
.route("/tables/:table/peers/", get(tables_peers))
Expand All @@ -157,11 +158,11 @@ async fn app() -> Result<(), Error> {
.route("/tables/:table/share/:mode/", get(table_share))
.route("/tables/:table/*key", get(table_get))
.route("/tables/:table/*key", put(table_insert))
.route("/tables/:table/*key", delete(table_delete))
.route("/tables/foreign_insert/", post(table_foreign_insert));
.route("/tables/:table/*key", delete(table_delete));

if config.read().await.http.hostname.is_some() {
router = router.route("/:table/*key", get(table_root_get));
router = router.route("/", get(table_root_get));
router = router.route("/*key", get(table_root_path_get));
}

let app = router
Expand Down Expand Up @@ -481,6 +482,15 @@ async fn table_foreign_insert(
}

async fn table_root_get(
State(state): State<AppState>,
method: Method,
headers: HeaderMap,
Host(host): Host,
) -> Response {
table_root_path_get(State(state), method, headers, Host(host), Path("index.html".to_string())).await
}

async fn table_root_path_get(
State(state): State<AppState>,
method: Method,
headers: HeaderMap,
Expand Down
Loading

0 comments on commit b4950cd

Please sign in to comment.