CLI to create web services with Actix
- Minimal server with health check and readiness check
- Fault-tolerant option can be enabled to use Bastion
- Logger middleware option can be enabled with
--request-loggerflag - Basic CRUD controllers
-
Unwraps to Crate Error - Database configurations
- Auth middleware option can be enabled with
--authflag - Basic Docker config can be enabled with flag
- Read routes configs from
Config.toml - Read models configs from
Config.toml
Not defining a Database will mean a
Contextwill be created to support a basicHashMap.
- If you don't have Rust in your computer you can run
make setupor visit https://rustup.rs/. - Make sure your
/usr/local/binis inPATH. - Than run
make build.
- Windows not yet supported
actix-cli 0.1.0
A CLI to create actix-web projects boilerplate
USAGE:
actix-cli [OPTIONS] --context <context> --name <name>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-c, --config-file <config-file> Config.toml file path
--context <context> Which database configuration. Currently only `InMemory` allowed [possible
values: InMemory]
-f, --fault-tolerant <fault-tolerant> Enables Bastion for fault tolerant system [default: true]
-n, --name <name> Defines project name in Cargo.toml
-r, --request-logger <request-logger> Enables request logger as `[IP:%a DATETIME:%t REQUEST:\"%r\" STATUS: %s
DURATION:%D X-REQUEST-ID:%{x-request-id}o] and `"[x-request-id:
Uuid::new_v4()]` [default: true]fault-tolerant:bool.request-logger:bool.name:String.config-file:std::path::PathBuf.context: case insetive enum containingInMemoryand in the futurePostgresDBandDynamoDB.
By executing command actix-cli -n maluco-cli -r true -f true --config-file actix-cli/Config.toml --context inmemory with the Config.toml as defined below in CRUD section the result is found in the repo
A few examples of Config.toml.
[crud]
name = "object"
[crud.routes]
create = "object/new"
read = "object/get/{id}"
update = "object/update/{id}"
delete = "object/delete/{id}"
list = "object/get"
[crud.model]
name = "String"
age = "usize"
school = "String"nameis required.routesis required, all routes should be Strings.- If
routesdon't start withname,namewill bem added to them. modelis required, all types should be Strings with valid Rust types.