1pub use webx_core::app::IHost;
22pub use webx_core::auth::{
23 IAuthenticationHandler, IAuthorizationPolicy, IClaims, IDynamicAuthorizer,
24};
25pub use webx_core::cache::{
26 cache_ext::DistributedCacheExtensions,
27 options::DistributedCacheEntryOptions,
28 trait_def::{CacheError, IDistributedCache},
29};
30pub use webx_core::config::{
31 bind_config, bind_root, load_appsettings, AppOptions, AppSection, CorsSection, IAppOptions,
32 JwtSection, MetricsSection, RateLimitSection, TlsSection,
33};
34pub use webx_core::dispatch_runtime::{dispatch_provider, DispatchRuntime};
35pub use webx_core::error::{Error, Result};
36pub use webx_core::form::{
37 sanitize_file_name, set_spool_root, spool_root, FormDeserializer, FormError, FormField,
38 FormFile, FormFileBuilder, MultipartForm, SPOOL_FILE_PREFIX,
39};
40pub use webx_core::handler::{IClaimsCarrier, IEventHandler, IHostedService, IRequestHandler};
41pub use webx_core::http::{
42 content_disposition_value, read_json_body, write_json_response, ByteRange, Disposition,
43 FileBody, FileSource, FromHttpContext, HttpStatus, IClaimsExt, IHttpContext, IHttpRequest,
44 IHttpResponse, Json, ResponseBody, SeekableReader, STREAM_BUF_SIZE,
45};
46pub use webx_core::mediator::build_pipeline_chain;
47pub use webx_core::mediator::{IEventRequest, IMediator, IRequest};
48pub use webx_core::middleware::IMiddleware;
49pub use webx_core::mode::AppMode;
50pub use webx_core::pagination::{PagedRequest, PagedResponse};
51pub use webx_core::paths::{
52 app_base, framework_root, looks_like_app_base, looks_like_framework_root,
53};
54pub use webx_core::pipeline::{BoxedNextFn, BoxedPipelineFuture, IPipelineBehavior};
55pub use webx_core::problem::{FieldError, ProblemDetails};
56pub use webx_core::request_context::RequestContext;
57pub use webx_core::route::diagnostics::{
58 duplicate_handlers, format_route_diagnostics, orphan_handlers, orphan_route_details,
59 orphan_routes, route_snapshots,
60};
61pub use webx_core::routing::{HttpMethod, IEndpoint, IRouter, RouteMeta};
62
63pub use webx_core::route::bind::bind_form_request;
65pub use webx_core::route::ext::{is_mediator_active, should_scan_endpoints, IServiceCollectionExt};
66pub use webx_core::route::params::try_deserialize_from_params;
67#[allow(deprecated)]
68pub use webx_core::route::scan::{
69 global_provider, set_global_provider, HandlerCache, HandlerEntry, HandlerRegistration,
70 HandlerRegistry, ParamMeta, RequestParamEntry, ResponseData, RouteDispatch, RouteDispatchFn,
71 RouteEntry,
72};
73
74pub use webx_host::auth_jwt::{init_jwt_secret, jwt_middleware, jwt_secret, JwtAuth, JwtClaims};
76pub use webx_host::authz::{
77 build_resource_policy_from_routes, collect_authorizers, resource_auth_middleware,
78 AuthorizerSet, ResourceAuthorization,
79};
80pub use webx_host::compression::{compress_gzip, CompressionConfig, CompressionMiddleware};
81pub use webx_host::context::{HttpContext, HttpRequest, HttpResponse};
82pub use webx_host::cors::{CorsConfig, CorsMiddleware};
83pub use webx_host::diagnostics::log_startup_diagnostics;
84pub use webx_host::endpoint::{
85 ControllerEndpoint, RequestEndpoint, StaticHtmlEndpoint, StaticJsonEndpoint,
86};
87pub use webx_host::health::{HealthCheckEntry, HealthCheckFn, HealthCheckRegistry, HealthStatus};
88pub use webx_host::memory_cache::MemoryCache;
89pub use webx_host::pipeline::{HandlerFn, MiddlewarePipeline};
90pub use webx_host::rate_limit::{RateLimitMiddleware, RateLimiter};
91pub use webx_host::request_id::RequestIdMiddleware;
92pub use webx_host::request_tracing::RequestTracing;
93pub use webx_host::router::Router;
94pub use webx_host::security_headers::SecurityHeadersMiddleware;
95pub use webx_host::server::{Host, HostAppBuilder, HostBuilder, Server, ServerHandle};
96#[cfg(feature = "testing")]
97pub use webx_host::testing::{free_port, spawn, spawn_with_health, wait_until_ready, TestServer};
98pub use webx_host::timing::TimingMiddleware;
99
100pub use webx_core::mediator::Mediator;
102
103pub use webx_spa::SpaMiddleware;
105
106pub mod spa {
116 pub use webx_spa::{
117 embed_assets, inventory, ContentEncoding, EmbeddedAsset, EmbeddedAssets, SpaMiddleware,
118 SpaSource, EMBED_ENV,
119 };
120}
121
122pub use webx_openapi::{generate_openapi_spec, APIUI_HTML};
124
125pub use webx_macros::{
127 authorize, claims, delete, embed_assets, endpoint, get, handler, main, post, put,
128 WebxRequestMeta,
129};
130
131pub use rust_dix;
133pub use rust_dix::inject;
134pub use rust_dix::ScopeFactory;
135pub use rust_dix_macros;
136pub use rust_dix_macros::{module, Inject};
137
138pub use async_trait::async_trait;
140pub use hyper;
141pub use serde;
142pub use serde_json;
143pub use tokio;
144
145#[deprecated(
163 since = "0.2.0",
164 note = "HTTP handlers should use `#[handler]` / `#[handler(inject)]` (inventory). \
165 register_handlers! remains for non-HTTP Mediator scenarios only."
166)]
167#[macro_export]
168macro_rules! register_handlers {
169 ($svc:ident, $($req:ty => $rsp:ty => $handler:ty),+ $(,)?) => {
170 $svc
171 $(
172 .singleton::<dyn $crate::IRequestHandler<$req, $rsp>>(
173 |_| ::std::sync::Arc::new(<$handler>::default())
174 )
175 )+
176 };
177}