salvo-static-files

Serve static directories and embedded assets in Salvo Rust web applications.

1|Updated Mar 16, 2024
One-click install
npx skills add https://github.com/tdcare/genies --skill salvo-static-files-tdcare
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: salvo-static-files
Source: https://github.com/tdcare/genies/tree/main/.qoder/skills/salvo-static-files
Command: npx skills add https://github.com/tdcare/genies --skill salvo-static-files-tdcare

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Serving static assets (CSS, JavaScript, images, and downloadable content) efficiently is essential for modern web apps; this skill provides a reliable way to serve static files and embedded assets for Salvo-based Rust applications.

Core Features & Use Cases

  • Serve static directories with configurable defaults and optional directory listings
  • Support embedded assets via rust-embed for single-binary deployments
  • SPA-friendly routing and per-type asset handling with caching controls

Quick Start

Run a sample to serve static files from a directory using StaticDir in a Salvo router.

Frequently Asked Questions about salvo-static-files

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I serve static files in a Salvo Rust web application?

Serve static files in a Salvo Rust web application by using the StaticDir API to configure directories, set defaults, and route assets like CSS, JS, and images directly through a Salvo router.

Can I embed static assets into a single-binary deployment using Salvo?

Embed static assets into a single-binary Salvo deployment by integrating rust-embed, which bundles CSS, JavaScript, and images directly into the compiled binary for self-contained distribution.

Does Salvo support SPA fallback routing for static files?

Salvo supports SPA-friendly routing for static files by configuring fallbacks in the StaticDir API, ensuring client-side routing requests correctly resolve to the application's index file.

How do I configure cache control for static assets served with Salvo?

Configure cache control for static assets served with Salvo by adjusting per-type routing settings in the StaticDir API, allowing distinct caching headers for CSS, JavaScript, images, and downloads.

Can I enable directory listing when serving static files with Salvo?

Enable directory listing when serving static files with Salvo by configuring optional directory behaviors in the StaticDir API, allowing users to browse and view contents of served directories.

What is the best way to handle per-type asset routing in Salvo?

Handle per-type asset routing in Salvo by using the StaticDir API to apply specific configurations and caching controls across different file types like CSS, JavaScript, images, and downloadable content.