Skip to content
View yiirs's full-sized avatar
😜
😜

Block or report yiirs

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
yiirs/README.md

yiirs

crates.io Apache 2.0 license

Rust Web开发脚手架,支持 salvoaxum 框架,并同时支持创建「单应用」和「多应用」

安装

cargo install yiirs

特点

  • ORM使用 sea-orm
  • Redis使用 redis-rs
  • 日志使用 tracing
  • 配置使用 config-rs
  • 命令行使用 clap
  • 异步运行时使用 tokio
  • 参数验证器使用 validator
  • 包含 Trace、认证、请求日志、Panic捕获 中间价
  • 简单好用的 API Result 统一输出方式

创建项目

单应用

yiirs new --name=demo # salvo
yiirs new --name=demo --axum # axum
.
├── Cargo.toml
├── Dockerfile
├── config.toml
└── src
    ├── app
    │   ├── api
    │   ├── cmd
    │   ├── middleware
    │   ├── router
    │   ├── service
    │   └── main.rs
    └── internal

多应用

# http
yiirs new --name=demo --app=foo --app=bar # salvo
yiirs new --name=demo --app=foo --app=bar --axum # axum
.
├── Cargo.toml
├── foo.dockerfile
├── bar.dockerfile
├── foo_config.toml
├── bar_config.toml
└── src
    ├── app
    │   ├── foo
    │   │   ├── api
    │   │   ├── cmd
    │   │   ├── middleware
    │   │   ├── router
    │   │   ├── service
    │   │   └── main.rs
    │   ├── bar
    │   │   ├── ...
    │   │   └── main.rs
    └── internal

创建应用

# 多应用项目适用,需在项目根目录执行(即:Cargo.toml所在目录)
yiirs app --name=foo --name=bar # 创建salvo应用
yiirs app --name=foo --name=bar --axum # 创建axum应用
.
├── Cargo.toml
├── foo.dockerfile
├── bar.dockerfile
├── foo_config.toml
├── bar_config.toml
└── src
    ├── app
    │   ├── foo
    │   │   ├── ...
    │   │   └── main.rs
    │   ├── bar
    │   │   ├── ...
    │   │   └── main.rs
    └── internal

Enjoy 😊

Pinned Loading

  1. yiirs yiirs Public

    Rust Web开发脚手架「Salvo & Axum」

    Rust 293 48

  2. contrib contrib Public

    Rust开发实用库

    Rust 1