1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#![doc = include_str!("../README.md")]
//!
//! To get started, see the [`static_router!`] macro.

#![warn(clippy::pedantic)]
#![warn(
	missing_copy_implementations,
	elided_lifetimes_in_paths,
	explicit_outlives_requirements,
	macro_use_extern_crate,
	meta_variable_misuse,
	missing_abi,
	missing_copy_implementations,
	missing_debug_implementations,
	missing_docs,
	non_ascii_idents,
	noop_method_call,
	pointer_structural_match,
	single_use_lifetimes,
	trivial_casts,
	trivial_numeric_casts,
	unreachable_pub,
	unused_crate_dependencies,
	unused_extern_crates,
	unused_import_braces,
	unused_lifetimes,
	unused_macro_rules,
	unused_qualifications,
	variant_size_differences
)]
#![forbid(unsafe_code)]

/// Create a static files router with the given name and static directory path.
///
/// The static directory path is relative to the crate root, not the caller file.
///
/// The resulting router serves the static files at the root. Use axum's router nesting feature if you want the static files to be scoped to something like `/static`.
///
/// # Syntax
///
/// The macro expects as arguments an identifier (the router name), then a comma, then a string literal (the static directory path).
///
/// # Examples
///
/// Create a router named `router` that serves the files in `static`.
///
/// ```no_compile
/// static_router!(router, "static");
/// ```
pub use static_router_macros::static_router;

#[doc(hidden)]
pub mod __private {
	pub use {axum, http, std, tower_http};
}