V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
PrivateRookie
V2EX  ›  Rust

用 actix-web 2.0 写的一个小工具

  •  
  •   PrivateRookie · Dec 24, 2019 · 4323 views
    This topic created in 2318 days ago, the information mentioned may be changed or developed.

    偶然看到一个 Json server 的 Rust 库 weld. 感觉挺好玩的, 但是代码比较老了, 试着用 actix-web 2.0 和 serde_json 重新实现了一个, 代码更简单了.

    项目地址: mockrs

    使用说明:

    cargo install --git https://github.com/PrivateRookie/mockrs.git
    
    mockrs --help
    
    mockrs 0.1.0
    PrivateRookie <[email protected]>
    a mock restful json http server
    
    USAGE:
        mockrs [OPTIONS] <db-file>
    
    FLAGS:
        -h, --help       Prints help information
        -V, --version    Prints version information
    
    OPTIONS:
            --host <host>    listen ip [env: MOCKRS_HOST=]  [default: 127.0.0.1]
            --port <port>    listen port [env: MOCKRS_PORT=9002]  [default: 9000]
    
    ARGS:
        <db-file>    json file as database [env: MOCKRS_DB_FILE=]
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1014 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:10 · PVG 06:10 · LAX 15:10 · JFK 18:10
    ♥ Do have faith in what you're doing.