Skip to content
/ ngyn Public

A progressive Rust framework for building scalable web applications through an opinionated architecture.

License

Notifications You must be signed in to change notification settings

ngyn-rs/ngyn

Repository files navigation

ngyn

ngyn (en·jn)

Crates.io Docs.rs License MSRV Made in Nigeria

A progressive framework in Rust for building scalable web servers.

More information about Ngyn can be found in the documentation.

Features

  • Battle tested Ergonomic API. (You'll love writing routes in ngyn)
  • Performance-balanced approaches
  • Optional Macro API for enhancing route handlers
  • Asynchronous access gates and middleware for handling requests and responses
  • Optional Asynchronous routing support for defining routes

Please note that Ngyn is still in its early stages of development, and the API is subject to change.

Example

This example demonstrates how to create a simple web server using Ngyn and Hyper Platform.

[dependencies]
ngyn = { version = "0.5" }

And here's the code:

use ngyn::prelude::*;

#[handler]
fn echo_hello() -> String {
    "Hello World!".to_string()
}


#[main]
async fn main() {
    let mut app = HyperApplication::default();
    app.any("*", echo_hello); // handle all routes and http methods
    let _ = app.listen("127.0.0.1:8080").await;
}

Contribution

Ngyn is an open-source project, and we welcome contributions from the community. Feel free to report issues, suggest enhancements, or submit pull requests to help us improve Ngyn.

If this project helped you, looks interesting or you're already making use of it, please drop a star and mention it to others.

License

Ngyn is licensed under the MIT License, allowing you to use, modify, and distribute the framework freely.