serve a static site, single page application or just a static file with Rust

Overview

cargo-server

tl;dr: Does the same as "python -m http.server" or "npx serve" but for Rust ecosystem.

cargo-server helps you serve a static site, single page application or just a static file (no matter if on your device or on the local network). It also provides a neat interface for listing the directory's contents.

Pre-built binaries are available on the Github Releases tab.

You can use cargo to install:

$ cargo install cargo-server

With cargo-binstall:

$ cargo binstall cargo-server

Quick example

Tree

Once cargo-server is installed, you can run this command inside your project's directory. It will create by default in 8000 port:

$ cargo server

To specify the port, you can use --port:

$ cargo server --port 3000

To open in your browser after run the command just add --open:

$ cargo server --open

You can also set a custom path using --path:

$ cargo server --path /Users/raphamorim/Documents/simple-wasm-frontend-app

Also is possible to run without any stdout using --quiet:

$ cargo server --quiet --open --path /Users/raphamorim/Documents/simple-wasm-frontend-app

Result:

Demo

You might also like...
Static Web Server - a very small and fast production-ready web server suitable to serve static web files or assets
Static Web Server - a very small and fast production-ready web server suitable to serve static web files or assets

Static Web Server (or SWS abbreviated) is a very small and fast production-ready web server suitable to serve static web files or assets.

A fast static site generator in a single binary with everything built-in. https://www.getzola.org

zola (né Gutenberg) A fast static site generator in a single binary with everything built-in. Documentation is available on its site or in the docs/co

A fast static site generator in a single binary with everything built-in. https://www.getzola.org

zola (né Gutenberg) A fast static site generator in a single binary with everything built-in. Documentation is available on its site or in the docs/co

Hot reload static web server for deploying mutiple static web site with version control.

SPA-SERVER It is to provide a static web http server with cache and hot reload. 中文 README Feature Built with Hyper and Warp, fast and small! SSL with

A file format-agnostic static site generator

mksite A file format-agnostic static site generator Installation If you already have Rust and Cargo installed: cargo install mksite Alternatively, you

🌟 For when you really just want to serve some files over HTTP right now!
🌟 For when you really just want to serve some files over HTTP right now!

miniserve - a CLI tool to serve files and dirs over HTTP For when you really just want to serve some files over HTTP right now! miniserve is a small,

Silkenweb - A library for writing reactive single page web apps

Silkenweb A library for building reactive single page web apps. Features Fine grained reactivity using signals to minimize DOM API calls No VDOM. Call

An example bdk + yew single page web wallet

bdk-yew-example This project builds a simple bdk-wasm based testnet wallet as a single page web app. The page can be hosted locally or automatically d

A template for a Rust-powered static-page Try Online interface

rust-tio-template A template for a Rust-powered static-page Try Online interface What is included This is an example setup that enables all of the fol

Serve-live: static directory server with change notification

Serve a directory of static files, with server-sent events for automatic refresh.

Simple low-level web server to serve file uploads with some shell scripting-friendly features

http_file_uploader Simple low-level web server to serve file uploads with some shell scripting-friendly features. A bridge between Web's multipart/for

Static site generator written in Rust
Static site generator written in Rust

Sedum is a static site generator written in Rust. It can be used locally or with a service like Netlify to generate websites on the fly. Usage Local P

Sūshì is a simple but customizable static site generator / blog generator written in Rust

sūshì Sūshì is a simple but customizable static site generator / blog generator written in Rust. Installation Install with Cargo (Recommended) cargo i

⚡ A Blazingly-Fast Static Site Generator, built with Rust.
⚡ A Blazingly-Fast Static Site Generator, built with Rust.

Stuart A Blazingly-Fast Static Site Generator. Download Now » Stuart is a very fast and flexible static site generator, with build times as low as 0.1

Kurzlink is a simple static site generator built in rust

kurzlink What is kurzlink? Kurzlink is a simple static site generator built in rust.

A hypersonic static-site generator written in Rust. 🚀 💊 🔥
A hypersonic static-site generator written in Rust. 🚀 💊 🔥

MANDY 🚀 💊 🔥 A hypersonic static-site generator written in Rust. 🚀 💊 🔥 ABOUT 📚 Mandy is fast, easy to use, easy to deploy, and very flexible! Ge

static site generator from markdown files.

Mdblog Static site generator from markdown files with features: TeX style math support file path is the post url file name is the post title post can

the best static site generator

the best static site generator you've ever seen

An ultra simple static site generator designed to appeal to technical as well as non technical users.

Hulk is an ultra simple static site generator designed to appeal to both technical and non technical users.

A fast static site generator in a single binary with everything built-in. https://www.getzola.org

zola (né Gutenberg) A fast static site generator in a single binary with everything built-in. Documentation is available on its site or in the docs/co

Zola 10.1k Jan 5, 2023
A file format-agnostic static site generator

mksite A file format-agnostic static site generator Installation If you already have Rust and Cargo installed: cargo install mksite Alternatively, you

Michelle S. 5 Nov 25, 2022
Static site generator written in Rust

Sedum is a static site generator written in Rust. It can be used locally or with a service like Netlify to generate websites on the fly. Usage Local P

Elly 1 Jan 5, 2022
Sūshì is a simple but customizable static site generator / blog generator written in Rust

sūshì Sūshì is a simple but customizable static site generator / blog generator written in Rust. Installation Install with Cargo (Recommended) cargo i

MrNothing233 2 Mar 20, 2022
A hypersonic static-site generator written in Rust. 🚀 💊 🔥

MANDY ?? ?? ?? A hypersonic static-site generator written in Rust. ?? ?? ?? ABOUT ?? Mandy is fast, easy to use, easy to deploy, and very flexible! Ge

✭ ANGEL DOLLFACE ✭ 5 Jun 30, 2023
static site generator from markdown files.

Mdblog Static site generator from markdown files with features: TeX style math support file path is the post url file name is the post title post can

Fu 51 Dec 6, 2022
the best static site generator

the best static site generator you've ever seen

Anirudh Balaji 14 Jan 24, 2022
An ultra simple static site generator designed to appeal to technical as well as non technical users.

Hulk is an ultra simple static site generator designed to appeal to both technical and non technical users.

Bilal Tariq 1 Dec 27, 2021
rublog /rʌblɑg/ is a static blog generator written in Rust

README README About rublog demo DEMO Install use Initialize from rublog-template rublog command Publishing the web page Development Plan TOML Front Ma

null 10 Jul 24, 2023
Serve a static site, single page application or just a static file with Rust

cargo-server tl;dr: Does the same as "python -m http.server" or "npx serve" but for Rust ecosystem. cargo-server helps you serve a static site, single

Raphael Amorim 18 Oct 14, 2022