Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutomic committed May 6, 2024
1 parent e679594 commit 23006ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugin_middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ where
let path = service_req.path().replace("/api/v3/", "").replace("/", "_");
// TODO: naming can be a bit silly, `POST /api/v3/post` becomes `api_before_post_post`
let plugin_hook = format!("api_before_{method}_{path}").to_lowercase();

info!("Calling plugin hook {}", &plugin_hook);
if let Some(mut plugins) = load_plugins()? {
if plugins.function_exists(&plugin_hook) {
Expand All @@ -79,6 +80,9 @@ where
}
}
let res = svc.call(service_req).await?;

// TODO: add after hook

Ok(res)
})
}
Expand Down

0 comments on commit 23006ba

Please sign in to comment.