Skip to content

runeleaf/rust-axum-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Axum API Example

axum

Setup

$ cargo install cargo-shuttle
$ cargo install cargo-watch
$ cargo install sqlx-cli

Format Rust code

$ rustup component add rustfmt
$ cargo fmt

Create Database

$ export DATABASE_URL=postgres://postgres:password@localhost:5432/rust_axum_development
or
$ cat > .env
DATABASE_URL=postgres://postgres:password@localhost:5432/rust_axum_development

$ export $(cat .env | xargs)

$ cargo sqlx database create

Migration

$ cargo sqlx migrate add create_users
$ cargo sqlx migrate run

Run Server

$ cargo watch -x run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published