All Projects → tomaka → Rouille

tomaka / Rouille

Licence: other
Web framework in Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Rouille

Koop
🔮 Transform, query, and download geospatial data on the web.
Stars: ✭ 505 (-18.15%)
Mutual labels:  server
Swagger Express Middleware
Swagger 2.0 middlware and mocks for Express.js
Stars: ✭ 543 (-11.99%)
Mutual labels:  server
Reflection
DEPRECATED
Stars: ✭ 592 (-4.05%)
Mutual labels:  server
Knowledge Kit
iOS、Web前端、后端、数据库、计算机网络、设计模式经验总结
Stars: ✭ 507 (-17.83%)
Mutual labels:  server
Ejabberd
Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
Stars: ✭ 5,077 (+722.85%)
Mutual labels:  server
Chatengine
Open source mtproto server written in golang with compatible telegram client
Stars: ✭ 544 (-11.83%)
Mutual labels:  server
James Project
Emails at the heart of your business logic!
Stars: ✭ 485 (-21.39%)
Mutual labels:  server
Ponzu
Headless CMS with automatic JSON API. Featuring auto-HTTPS from Let's Encrypt, HTTP/2 Server Push, and flexible server framework written in Go.
Stars: ✭ 5,373 (+770.83%)
Mutual labels:  server
Chinachu
Most Lovely DVR Software in Japan.
Stars: ✭ 542 (-12.16%)
Mutual labels:  server
Swiftserverside Vapor
🦄 Swift server open source projects based on the Swift 4.1 and Vapor 3 frameworks. (Swift 服务端开源项目)
Stars: ✭ 588 (-4.7%)
Mutual labels:  server
Abc
A better Deno framework to create web application.
Stars: ✭ 514 (-16.69%)
Mutual labels:  server
Nve
Run any command on specific Node.js versions
Stars: ✭ 531 (-13.94%)
Mutual labels:  server
Rust Embed
Rust Macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.
Stars: ✭ 548 (-11.18%)
Mutual labels:  server
Nginx Rtmp Docker
Docker image with Nginx using the nginx-rtmp-module module for live multimedia (video) streaming.
Stars: ✭ 506 (-17.99%)
Mutual labels:  server
Laravel Server Monitor
Don't let your servers just melt down
Stars: ✭ 595 (-3.57%)
Mutual labels:  server
Ream
A super-fast SSR framework for Vue.js 3 ⚡️
Stars: ✭ 497 (-19.45%)
Mutual labels:  server
Live Torrent
Torrent Web Client
Stars: ✭ 546 (-11.51%)
Mutual labels:  server
Mailcatcher
Catches mail and serves it through a dream.
Stars: ✭ 5,512 (+793.35%)
Mutual labels:  server
Pilbox
An image resize application server
Stars: ✭ 597 (-3.24%)
Mutual labels:  server
Milo
Eclipse Milo™ - an open source implementation of OPC UA (IEC 62541).
Stars: ✭ 587 (-4.86%)
Mutual labels:  server

Rouille, a Rust web micro-framework

Rouille is a micro-web-framework library. It creates a listening socket and parses incoming HTTP requests from clients, then gives you the hand to process the request.

Rouille was designed to be intuitive to use if you know Rust. Contrary to express-like frameworks, it doesn't employ middlewares. Instead everything is handled in a linear way.

Concepts closely related to websites (like cookies, CGI, form input, etc.) are directly supported by rouille. More general concepts (like database handling or templating) are not directly handled, as they are considered orthogonal to the micro web framework. However rouille's design makes it easy to use in conjunction with any third-party library without the need for any glue code.

Documentation

Getting started

If you have general knowledge about how HTTP works, the documentation and the well-documented examples are good resources to get you started.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

FAQ

What about performances?

Async I/O, green threads, coroutines, etc. in Rust are still very immature.

The rouille library just ignores this optimization and focuses on providing an easy-to-use synchronous API instead, where each request is handled in its own dedicated thread.

Even if rouille itself was asynchronous, you would need asynchronous database clients and asynchronous file loading in order to take advantage of it. There are currently no such libraries in the Rust ecosystem.

Once async I/O has been figured out, rouille will be (hopefully transparently) updated to take it into account.

But is it fast?

On the author's old Linux machine, some basic benchmarking with wrk -t 4 -c 4 shows the following results:

  • The hello-world example of rouille yields ~22k requests/sec.
  • A hello world in nodejs (with http.createServer) yields ~14k requests/sec.
  • The hello-world example of tokio-minihttp (which is supposedly the fastest HTTP server that currently exists) yields ~77k requests/sec.
  • The hello example of hyper (which uses async I/O with mio as well) yields ~53k requests/sec.
  • A hello world in Go yields ~51k requests/sec.
  • The default installation of nginx yields ~39k requests/sec.

While not the fastest, rouille has reasonable performances. Amongst all these examples, rouille is the only one to use synchronous I/O.

Are there plugins for features such as database connection, templating, etc.

It should be trivial to integrate a database or templates to your web server written with rouille. Moreover plugins need maintenance and tend to create a dependency hell. In the author's opinion it is generally better not to use plugins.

But I'm used to express-like frameworks!

Instead of doing this: (pseudo-code)

server.add_middleware(function() {
    // middleware 1
});

server.add_middleware(function() {
    // middleware 2
});

server.add_middleware(function() {
    // middleware 3
});

In rouille you just handle each request entirely manually:

// initialize everything here

rouille::start_server(..., move |request| {
    // middleware 1

    // middleware 2

    // middleware 3
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].