https://github.com/gnostr-org/tejmagar
https://github.com/gnostr-org/tejmagar
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gnostr-org/tejmagar
- Owner: gnostr-org
- License: mit
- Created: 2024-03-20T15:28:28.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-07-18T19:31:37.000Z (10 months ago)
- Last Synced: 2025-01-19T08:16:01.520Z (4 months ago)
- Language: Rust
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tejmagar
## rusty_web demo
Rusty web is a simple to use, fully customizable lightweight web framework for rust developers.
[Learn rusty web](https://tejmagar.github.io/rusty-web/)Consider using [Racoon](https://github.com/tejmagar/racoon/) if you need asynchronous code.
## Installation
```
[dependencies]
rusty-web = "0.0.2"
```## Sample
```rust
use rusty_web::paths::{Path, Paths};
use rusty_web::request::Request;
use rusty_web::response::Response;
use rusty_web::server::run_server;
use rusty_web::status::Status;fn home(request: Request, mut response: Response) {
response.html(Status::Ok, "Home Page".to_string()).send();
}fn about(request: Request, mut response: Response) {
response.html(Status::Ok, "About Us".to_string()).send();
}fn main() {
let paths: Paths = vec![
Path::new("/", home),
Path::new("/about/", about),
];run_server("0.0.0.0:8080", paths);
}
```## Conclusion
This framework don't force you to follow particular format. You can stream response however you like.
=======
# tejmagar
>>>>>>> f8840f1 (cargo init)