Giter Club home page Giter Club logo

rust-todo's Introduction

rust-todo

todo demo app by gotham

rust-todo

安装

默认你已经安装了 Rust,如果没有,请参考 Install Rust

首先需要有一个 Postgres 数据库,如果没有可以用 Docker 快速安装

docker run -d\
    --name pg-db \
    -e POSTGRES_ROOT_PASSWORD=1234TttT \
    -e POSTGRES_USER=root \
    -p 5433:5433 \
    -p 5432:5432 \
    postgres

接着安装 diesel_cli,完整文档参考官网 Diesel - Getting Start

# 需要安装 pg 客户端
sudo apt install postgresql-client
cargo install diesel_cli --no-default-features --features postgres

如果数据库不在本地运行或者修改了端口,请修改 .env 文件中的 DATABASE_URL 为新的地址、用户名和密码

接着在项目根目录下运行以下命令初始化数据库

diesel setup
diesel migration run

数据初始化完成后就可以运行项目

cargo run

访问 http://localhost:8000 即可看到页面

rust-todo's People

Contributors

privaterookie avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.