rs-express
rs-express is a simple web framework written in Rust that tries to be as close to Express.js as possible.
The goal of this project is to allow Node.js web developers to easily migrate their web services to Rust, without the hassle of learning a new web framework.
Most APIs will be very similar or even identical to the Node.js version, under the limitations of Rust.
Just to show how similar it can be, here is the Hello World example from express-js github repository:
const express = require
const app =
app.
app.
And here is the one in rs-express:
use ;
async
Installation
[]
= "0.1.0"
Features
- Familiar API
- Focus on high performance
- Simple and easy of use
- Application level state
- Simple and robust routing
- Easy testing capabilities
Also, since it is built on top of hyper, it provides (taken from their README)
- HTTP/1 and HTTP/2
- Asynchronous design
- Leading in performance
- Tested and correct
- Extensive production use
Examples
All the examples are under the examples folder.
To run a specific example, run the following command:
cargo run --example <example-name>
For example cargo run --example hello-world.
To get a response, use this address: http://localhost:3000 .
For example, curl http://localhost:3000/hello will return Hello, World.