Skip to content
forked from OctaneWeb/Octane

A web server modeled after express in Rust.

License

Notifications You must be signed in to change notification settings

TheWastl/Octane

 
 

Repository files navigation

Octane 🚀

A high-powered web server aimed at minimizing dependencies while maintaining speed. Modeled after Express, a popular Javascript web framework, Octane combines the speed of Rust with the ease-of-use and flexibility of Express to create the optimal user experience.

  • Multithreaded 🚄
  • Asynchronous design 🐆
  • Easy to use, intuitive design 🌱
  • TLS enabled, rustls/openssl ready 🔒
  • Minimal dependencies (working to reduce them more!) 💕

Not production ready

The web server is not production ready yet, there are many things left to do before we are production ready. Use at your own risk! Development is being done right now, lots of things are untested in the library. If you would like to report any details, use issues or the chat!

Basic Usage

Create an octane instance, and then you can register your methods on it using app.METHOD()

use octane::prelude::*;
use std::error::Error;

#[octane::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let mut app = Octane::new();
    app.ssl(8001)
        .key("templates/key.pem")
        .cert("templates/cert.pem"); // Setup ssl

    app.get(
        "/",
        route!(|req, res| {
            res.send_file("templates/test.html").expect("File not found!");
            Flow::Next
        }),
    )?;

    app.add(Octane::static_dir(path!("/templates/")))?;
    app.listen(8000, || println!("Server Started!")).await
}

Docs

Documentation will be available on docs.rs.

Roadmap to production

  • Http2
  • Stable SSL support
  • Efficient error handling (using enums instead of Box<dyn Error>)
  • Web socket library
  • Multipart/json form handling (being worked on)
  • Logging
  • Much more....

Contribute

Checkout CONTRIBUTING.md for info on how to contribute to this project

License

OctaneWeb/Octane is licensed under the MIT License.

About

A web server modeled after express in Rust.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.6%
  • Other 0.4%