- cargo install cargo-make
- cargo install cargo-watch
- diesel
# Linux/MacOS
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/diesel-rs/diesel/releases/download/v2.2.1/diesel_cli-installer.sh | sh
# Windows
powershell -c "irm https://github.com/diesel-rs/diesel/releases/download/v2.2.1/diesel_cli-installer.ps1 | iex"
# Copy environment variables
cp .env.example .env
# Run with option 1
cargo make dev
# Run with option 2
cargo watch -c -w src -x run
# build rust application
cargo build --release
# run the application
./target/release/conexipro
It does not required to run migration on production. However we might need to set APP_ENV=production
in environment variables.
# run
diesel migration run
# rollback
diesel migration revert
# install pm2
npm install -g pm2
# run application
pm2 start
# check log
pm2 log conexipro
# check instances
pm2 list conexipro
openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1