Sword
Structured web framework for rust built on top of axum.
Designed to build server application with less boilerplate and more simplicity.
It takes advantage of the tokio ecosystem to bring you performance with nice DX.
Features
- Macro-based routing - Clean and intuitive route definitions
- JSON-first design - Built with JSON formats as priority
- Built-in validation - Support with
serdeandvalidatorcrates - RFC-compliant HTTP responses - Using
axum_responsescrate - Express-Like - It provides a
Contextobject with utility methods for request handling - Dependency Injection - Built-in DI support using
shakucrate - Middleware support - Easily add middleware to routes or controllers
- Asynchronous by default - Built on top of
axumandtokio
Usage
Add to your Cargo.toml
[]
= "0.1.7"
Other useful dependencies
# Data serialization and deserialization
= { = "*", = ["derive"] }
# JSON data handling
= "*"
# Data validation and schema definition
= { = "*", = ["derive"] }
Basic web server
use *;
use Value;
async
More Examples
See the examples directory for more advanced usage.
Hot reloading
In the case of use hot reloading, you need to install dioxus-cli:
See the hot reloading example for more details.
Changelog
See CHANGELOG.md for more details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request. See CONTRIBUTING.md for more details.