impulse-static-server

Crates.ioimpulse-static-server
lib.rsimpulse-static-server
version1.0.0-alpha.6
created_at2025-07-21 21:24:00.311084+00
updated_at2025-11-14 20:08:26.427953+00
descriptionSimple static server
homepage
repository
max_upload_size
id1762697
size131,070
Klimenty Titov (markcda)

documentation

README

impulse-static-server

Simple static server. Features:

  • running on top of impulse-server-kit (see configuration example)
  • serves all your files from dist or /usr/local/frontend-dist/ folder
  • when receives any request other than /, it returns index.html, excluding files
  • provides in-memory cache for files less than 16 MiB via CustomStaticRouter::new_with_cacher or by default - with ETag and Last-Modified

Build

This project is supporting Deployer. You can build server with:

deployer build

Or, alternatively, just build with cargo:

cargo build --release

Usage

  1. Place your files inside dist folder.
  2. Place impulse-static-server executable near dist folder.
  3. Start ./impulse-static-server.

[!NOTE] There is no need to specify working dir, static server must work with distribution files placed nearly.

Usage as a library

Just include it into your Cargo.toml:

[dependencies]
impulse-static-server = { git = "https://github.com/impulse-sw/impulse-kit.git", tag = "0.11" }

and use one of these functions:

  • frontend_router - same behavior as the binary Static Server
  • frontend_router_from_given_dist - you can specify any dist folder you want
Commit count: 0

cargo fmt