Skip to content

treizexiii/rust-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webapi

Development

Setup

Create env with config.toml or on container's config

SERVICE_DB_URL=
SERVICE_PWD_KEY=
SERVICE_TOKEN_KEY=
SERVICE_TOKEN_DURATION_SEC=

Tools

cargo install cargo-watch
cargo install --locked cargo-watch # on windows

Server side

cargo watch -q -c -w src/ -w .cargo/ -x run

Client side

cargo watch -q -c -w examples/ -x "test -q quick_dev -- --nocapture"

Start db

docker run -d --rm --name postgres-rust -p 5434:5432 -e POSTGRES_PASSWORD=welcome postgres:16

start pg terminal

docker exec -it -u postgres postgres psql

Build

Docker

docker build -f .\Dockerfile -t rustapi:1.0 . 
docker run -p 8080:8080 --name rust-api rustapi:1.0

Unit test

cargo watch -q -c -x "test -- --nocapture"

cargo watch -q -c -x "test {MOD_NAME} -- --nocapture"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages