$ cargo loco generate scaffold post title:string content:textadded: "src/controllers/post.rs" injected: "src/controllers/mod.rs" injected: "src/app.rs" ...$ cargo loco start▄ ▀ ▀ ▄ ▄ ▀ ▄ ▄ ▄▀ ▄ ▀▄▄ ▄ ▀ ▀ ▀▄▀█▄ ▀█▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ▀▀█ ██████ █████ ███ █████ ███ █████ ███ ▀█ ██████ █████ ███ █████ ▀▀▀ █████ ███ ▄█▄ ██████ █████ ███ █████ █████ ███ ████▄ ██████ █████ ███ █████ ▄▄▄ █████ ███ █████ ██████ █████ ███ ████ ███ █████ ███ ████▀ ▀▀▀██▄ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ██▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ https://loco.rsenvironment: development database: automigrate logger: disabled compilation: debug modes: serverlistening on localhost:5150
Model your business with rich entities and avoid writing SQL, backed by SeaORM. Build relations, validation and custom logic on your entities for the best maintainability.
pub async
Handle Web requests parameters, body, validation, and render a response that is content-aware. We use Axum for the best performance, simplicity and extensibility.
// Literals
text
// Tera view engine
.view
render
// strongly typed JSON responsed, backed by `serde`
json
// Etags, cookies, and more
.etag?.empty
render
Use server-rendered templates with Tera or JSON. Loco can render views on the server or work with a frontend app seamlessly. Configure your fullstack set up any way you like.
Perform compute or I/O intensive jobs in the background with a Redis backed queue, or with threads. Implementing a worker is as simple as implementing a perform
function for the Worker
trait.
)
Easily generate deployment configurations with a guided CLI interface. Select from deployment options for tailored deployment setups.
jobs:
db_vaccum:
run: "db_vaccum.sh"
shell: true
schedule: "0 0 * * *"
tags:
send_birthday:
run: "user_birthday_task"
schedule: "Run every 2 hours"
tags:
Simplifies the traditional, often cumbersome crontab system, making it easier and more elegant to schedule tasks or shell scripts.