apub_inbox
: Add /inbox
route
This commit is contained in:
parent
e72fa092fb
commit
d5064a2c14
2 changed files with 11 additions and 1 deletions
|
@ -16,6 +16,7 @@ async fn main() -> anyhow::Result<std::convert::Infallible> {
|
|||
|
||||
log::trace!("Creating Axum router...");
|
||||
let app = axum::Router::new()
|
||||
.route("/inbox", axum::routing::post(route::inbox_handler))
|
||||
.route("/.healthcheck", axum::routing::get(route::healthcheck_handler))
|
||||
.layer(Extension(Arc::new(mj)));
|
||||
log::trace!("Axum router created successfully!");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use axum::http::StatusCode;
|
||||
use axum::http::{Response, StatusCode};
|
||||
use acrate_database::connect::connect_async;
|
||||
|
||||
pub async fn healthcheck_handler() -> Result<StatusCode, StatusCode> {
|
||||
|
@ -12,3 +12,12 @@ pub async fn healthcheck_handler() -> Result<StatusCode, StatusCode> {
|
|||
log::trace!("Healthcheck successful! Everything's fine!");
|
||||
Ok(StatusCode::NO_CONTENT)
|
||||
}
|
||||
|
||||
pub async fn inbox_handler() -> Result<Response<String>, StatusCode> {
|
||||
log::debug!("Handling an inbox request!");
|
||||
|
||||
log::trace!("Creating a blank response...");
|
||||
let mut response = Response::new("".to_string());
|
||||
|
||||
Ok(response)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue