Quick Overview
Magpie is a lightweight and flexible web framework for building modern web applications in Rust. It provides a simple and intuitive API for handling HTTP requests, routing, middleware, and more, making it a great choice for developers looking to build scalable and efficient web applications.
Pros
- Lightweight and Performant: Magpie is built on top of the Hyper HTTP library, which is known for its high performance and low overhead.
- Flexible and Extensible: Magpie's modular design allows developers to easily integrate third-party libraries and customize the framework to fit their specific needs.
- Asynchronous by Default: Magpie leverages Rust's async/await syntax, making it easy to write concurrent and scalable web applications.
- Comprehensive Documentation: The Magpie project has detailed documentation that covers a wide range of topics, from getting started to advanced usage.
Cons
- Relatively New: Magpie is a relatively new web framework, and as such, it may not have the same level of community support and third-party libraries as some more established frameworks.
- Learning Curve: Rust's syntax and concurrency model can be challenging for developers who are new to the language, which may make it harder to get started with Magpie.
- Limited Ecosystem: While Magpie is a powerful framework, the Rust ecosystem for web development may not be as mature as some other languages, which could limit the availability of third-party libraries and tools.
- Niche Adoption: Rust is still a relatively niche language, which means that Magpie may not have the same level of adoption and community support as some more popular web frameworks.
Code Examples
Here are a few examples of how to use Magpie:
- Basic Server Setup:
use magpie::prelude::*;
#[tokio::main]
async fn main() {
let app = App::new()
.route("/", get(|| async { "Hello, Magpie!" }))
.run("127.0.0.1:3000")
.await;
}
- Handling Route Parameters:
use magpie::prelude::*;
#[tokio::main]
async fn main() {
let app = App::new()
.route("/users/:id", get(|req: Request| async move {
let id = req.param("id").unwrap();
format!("User ID: {}", id)
}))
.run("127.0.0.1:3000")
.await;
}
- Middleware and Logging:
use magpie::prelude::*;
async fn logger(req: Request, next: Next<'_>) -> Response {
println!("Incoming request: {:?}", req);
next.run(req).await
}
#[tokio::main]
async fn main() {
let app = App::new()
.use_middleware(logger)
.route("/", get(|| async { "Hello, Magpie!" }))
.run("127.0.0.1:3000")
.await;
}
Getting Started
To get started with Magpie, you'll need to have Rust installed on your system. You can then create a new Magpie project using Cargo:
cargo new my-magpie-app
cd my-magpie-app
Next, add the Magpie dependency to your Cargo.toml
file:
[dependencies]
magpie = "0.5.0"
You can then write your Magpie application in the src/main.rs
file, using the examples provided above as a starting point. Once you're ready to run your application, use the following command:
cargo run
This will start your Magpie server and make it available at http://127.0.0.1:3000
.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Magpie
ð English | ç®ä½ä¸æ
Magpie is a lightweight window scaling tool that comes equipped with various efficient scaling algorithms and filters. Its primary purpose is to enhance game graphics and enable non-fullscreen games to display in fullscreen mode.
We are using Weblate for localization work and would appreciate your help in translating Magpie into more languages.
ð Download
ð FAQ
ð Built-in effects
ð Compilation guide
ð Contributing
Features
- Scale any window to fullscreen
- Numerous built-in algorithms, including Lanczos, Anime4K, FSR, Adaptive Sharpen, various CRT shaders, and more
- WinUI-based user interface with support for light and dark themes
- Create configuration profiles for specific windows
- Multi-monitor support
How to use
-
Configuring scaling modes
Magpie provides some simple scaling modes by default, but it is recommended to configure them according to your specific use case. Then, change the global scaling mode on the "Profiles"-"Defaults" page.
-
Scaling a window
To scale a window, bring the desired window to the foreground and press the shortcut key (default is Win+Shift+A) to display it in fullscreen mode. Note that the window to be scaled must be in windowed mode, not maximized or fullscreen mode. You can also use the "Scale after xs" button on the "Home" page, and Magpie will automatically scale the foreground window after a few seconds.
-
Creating profiles for windows
This allows you to save configurations specific to a particular window. Magpie also supports automatically activate scaling when that window is brought to the foreground.
-
Customizing effects
Magpie uses Direct3D compute shader to implement effects, but the syntax has been extended to define resources and organize multiple passes. For more information, please refer to MagpieFX. Those with experience in shader writing can easily create custom effects.
Screenshots
System requirements
- Windows 10 v1903+ or Windows 11
- DirectX feature level 11
Hints
-
If you have set DPI scaling and the window you want to scale does not support high DPI (which is common in older games), it is recommended to first enter the program's compatibility settings and set "High DPI scaling override" to "Application".
-
Some games support zooming the window, but with extremely naive algorithms. Please set the resolution to the built-in (best) option.
Acknowledgement â¨
Thanks go to these wonderful people:
This project follows the all-contributors specification. Contributions of any kind are welcome!
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot