Giter Site home page Giter Site logo

octane's Introduction

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.

octane's People

Contributors

aplet123 avatar daksh14 avatar neverrare avatar osrepnay avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.