spring-rs is a microservice framework written in Rust, similar to SpringBoot in java. spring-rs provides an easily extensible plug-in system for integrating excellent projects in the Rust community, such as axum, sqlx, sea-orm, etc.
Compared with SpringBoot in java, spring-rs has higher performance and lower memory usage, allowing you to completely get rid of the bloated JVM and travel light.
Example
use spring::{get, route, auto_config, App};
use spring_sqlx::{
sqlx::{self, Row},
ConnectPool, SqlxPlugin
};
use spring_web::{
error::Result, extractor::{Path, Component}, handler::TypeRouter, response::IntoResponse, Router,
WebConfigurator, WebPlugin,
};
use anyhow::Context;
#[auto_config(WebConfigurator)]
#[tokio::main]
async fn main() {
App::new()
.add_plugin(SqlxPlugin)
.add_plugin(WebPlugin)
.run()
.await
}
#[get("/")]
async fn hello_world() -> impl IntoResponse {
"hello world"
}
#[route("/hello/:name", method = "GET", method = "POST")]
async fn hello(Path(name): Path<String>) -> impl IntoResponse {
format!("hello {name}")
}
#[get("/version")]
async fn sqlx_request_handler(Component(pool): Component<ConnectPool>) -> Result<String> {
let version = sqlx::query("select version() as version")
.fetch_one(&pool)
.await
.context("sqlx query failed")?
.get("version");
Ok(version)
}
spring-rs
Project Details
- mowei-git/spring-rs
- MIT License
- Last Updated: 3/27/2025
Recomended MCP Servers
MCP server to convert a diagram to picture using kroki.io
MCP Server to interact with Google Gsuite prodcuts
A zero-configuration tool for automatically exposing FastAPI endpoints as Model Context Protocol (MCP) tools.
Yeoman mcp so AI can scaffold projects
A Model Context Protocol server allows to interact with Twitter, enabling posting tweets and searching Twitter.
A model context protocol server for zulip
一键导出PC微信聊天记录工具
mcp-server
my-first-mcp





