add services state to router
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
aebae11c82
commit
c2267d4c03
1 changed files with 6 additions and 1 deletions
|
@ -2,13 +2,18 @@ use std::sync::Arc;
|
||||||
|
|
||||||
use axum::{response::IntoResponse, routing::get, Router};
|
use axum::{response::IntoResponse, routing::get, Router};
|
||||||
use conduit::{Error, Server};
|
use conduit::{Error, Server};
|
||||||
|
use conduit_service as service;
|
||||||
use http::Uri;
|
use http::Uri;
|
||||||
use ruma::api::client::error::ErrorKind;
|
use ruma::api::client::error::ErrorKind;
|
||||||
|
|
||||||
extern crate conduit_api as api;
|
extern crate conduit_api as api;
|
||||||
|
|
||||||
pub(crate) fn build(server: &Arc<Server>) -> Router {
|
pub(crate) fn build(server: &Arc<Server>) -> Router {
|
||||||
let router = Router::new().fallback(not_found).route("/", get(it_works));
|
let state = service::services();
|
||||||
|
let router = Router::new()
|
||||||
|
.route("/", get(it_works))
|
||||||
|
.fallback(not_found)
|
||||||
|
.with_state(state);
|
||||||
|
|
||||||
api::router::build(router, server)
|
api::router::build(router, server)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue